11 Replies - 1034 Views - Last Post: 02 July 2013 - 05:18 PM Rate Topic: -----

#1 cycangfx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-July 13

VB.NET Tab Control Problems

Posted 02 July 2013 - 10:28 AM

Hi,

My goal get some tab control look exactly like this:

Posted Image

I have researched multiple custom tab controls made. They do not tell me how I can customize the tabs, and no good tutorial on learning them. So far, I have taken this code to transform the image into code:

[Parent Class]
Imports System.Drawing.Drawing2D, System.IO

'-------------------------------------
'TabControlDesigner
'
'Creator: Eprouvez
'Updated: 6/6/2012
'Date: 6/5/2012
'Version: 1.1.1
'
'Credits to:
'Aeonhack
'mavamaarten
'
'Update:
'Fixed a bug where ColorHook wasn't properly working when the control was created
'--------------------------------------

MustInherit Class TabControlDesigner
    Inherits TabControl

    Protected G As Graphics
    Protected State As MouseState
    Protected Coordinates As Point

    Enum MouseState As Integer
        None = 0
        Over = 1
        Down = 2
    End Enum

#Region " Routines "

    Sub New()
        SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.DoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
        DoubleBuffered = True
        SizeMode = TabSizeMode.Fixed
        ItemSize = New Size(250, 26)
    End Sub

    Sub SetState(ByVal current As MouseState)
        State = current
        Invalidate()
    End Sub

#End Region

#Region " Hooks "

    Protected MustOverride Sub TabPaint(ByVal Index As Integer)

    Protected MustOverride Sub ColorHook()
    Protected Overridable Sub PaintHook()
    End Sub

#End Region

#Region " Properties "

    Private _InactiveIconOpacity As Integer = 50
    Public Property InactiveIconOpacity As Integer
        Get
            Return _InactiveIconOpacity
        End Get
        Set(ByVal value As Integer)
            If IsNothing(value) Then value = 50
            If value < 0 Then value = 0
            If value > 100 Then value = 100
            _InactiveIconOpacity = value
        End Set
    End Property

    Private _PanelColor As Color
    Public Property PanelColor() As Color
        Get
            Return _PanelColor
        End Get
        Set(ByVal value As Color)
            _PanelColor = value
        End Set
    End Property

    Private Items As New Dictionary(Of String, Color)
    Property Colors() As Bloom()
        Get
            Dim T As New List(Of Bloom)
            Dim E As Dictionary(Of String, Color).Enumerator = Items.GetEnumerator

            While E.MoveNext
                T.Add(New Bloom(E.Current.Key, E.Current.Value))
            End While

            Return T.ToArray
        End Get
        Set(ByVal value As Bloom())
            For Each B As Bloom In value
                If Items.ContainsKey(B.Name) Then Items(B.Name) = B.Color
            Next

            InvalidateCustimization()
            ColorHook()
            Invalidate()
        End Set
    End Property

    Private _Customization As String
    Property Customization() As String
        Get
            Return _Customization
        End Get
        Set(ByVal value As String)
            If value = _Customization Then Return

            Dim Data As Byte()
            Dim Items As Bloom() = Colors

            Try
                Data = Convert.FromBase64String(value)
                For I As Integer = 0 To Items.Length - 1
                    Items(I).Color = Color.FromArgb(BitConverter.ToInt32(Data, I * 4))
                Next
            Catch
                Return
            End Try

            _Customization = value

            Colors = Items
            ColorHook()
            Invalidate()
        End Set
    End Property
#End Region

#Region " Property Helpers "

    'Credits to Aeonhack
    Protected Function GetPen(ByVal name As String) As Pen
        Return New Pen(Items(name))
    End Function
    Protected Function GetPen(ByVal name As String, ByVal width As Single) As Pen
        Return New Pen(Items(name), width)
    End Function
    Protected Function GetBrush(ByVal name As String) As SolidBrush
        Return New SolidBrush(Items(name))
    End Function
    Protected Function GetColor(ByVal name As String) As Color
        Return Items(name)
    End Function
    Protected Sub SetColor(ByVal name As String, ByVal value As Color)
        If Items.ContainsKey(name) Then Items(name) = value Else Items.Add(name, value)
    End Sub
    Protected Sub SetColor(ByVal name As String, ByVal r As Byte, ByVal g As Byte, ByVal b As Byte)
        SetColor(name, Color.FromArgb(r, g, B)/>/>)
    End Sub
    Protected Sub SetColor(ByVal name As String, ByVal a As Byte, ByVal r As Byte, ByVal g As Byte, ByVal b As Byte)
        SetColor(name, Color.FromArgb(a, r, g, B)/>/>)
    End Sub
    Protected Sub SetColor(ByVal name As String, ByVal a As Byte, ByVal value As Color)
        SetColor(name, Color.FromArgb(a, value))
    End Sub
    Private Sub InvalidateCustimization()
        Dim M As New MemoryStream(Items.Count * 4)

        For Each B As Bloom In Colors
            M.Write(BitConverter.GetBytes(B.Color.ToArgb), 0, 4)
        Next

        M.Close()
        _Customization = Convert.ToBase64String(M.ToArray)
    End Sub

#End Region

#Region " Drawing Methods "

    Function Measure(ByVal Text As String) As SizeF
        Return G.MeasureString(Text, Font)
    End Function
    Function Measure(ByVal Text As String, ByVal Font As Font) As SizeF
        Return G.MeasureString(Text, Font)
    End Function
    Function Center(ByVal Text As String, ByVal Area As Rectangle) As Point
        Return Center(Text, Font, Area)
    End Function
    Function Center(ByVal Text As String, ByVal Font As Font, ByVal Area As Rectangle) As Point
        Return Center(Text, Font, Area, 0, 0)
    End Function
    Function Center(ByVal Text As String, ByVal Font As Font, ByVal Area As Rectangle, ByVal XOffset As Integer, ByVal YOffset As Integer) As Point
        Dim M = Measure(Text, Font)
        If Font.Style = FontStyle.Bold Then
            Return New Point(CInt(Area.X + 10), CInt(Area.Y + 8))
        Else
            Return New Point(CInt(Area.X + 15), CInt(Area.Y + 8))
        End If

    End Function
    Function ToPen(ByVal color As Color) As Pen
        Return New Pen(color)
    End Function
    Function ToPen(ByVal color As Color, ByVal width As Single) As Pen
        Return New Pen(color, width)
    End Function
    Function ToBrush(ByVal color As Color) As Brush
        Return New SolidBrush(color)
    End Function
    Function RGB(ByVal Red As Integer, ByVal Green As Integer, ByVal Blue As Integer) As Color
        Return Color.FromArgb(Red, Green, Blue)
    End Function
    Function ARGB(ByVal Alpha As Integer, ByVal color As Color) As Color
        Return color.FromArgb(Alpha, color)
    End Function
    Function ARGB(ByVal Alpha As Integer, ByVal Red As Integer, ByVal Green As Integer, ByVal Blue As Integer) As Color
        Return Color.FromArgb(Alpha, Red, Green, Blue)
    End Function
    Function Shrink(ByVal rectangle As Rectangle, ByVal Offset As Integer) As Rectangle
        Return Shrink(rectangle, Offset, True)
    End Function
    Function Shrink(ByVal rectangle As Rectangle, ByVal Offset As Integer, ByVal CenterPoint As Boolean) As Rectangle
        Dim O = If(CenterPoint = True, Offset, 0)
        Dim R = New Rectangle(rectangle.X + O, rectangle.Y + O, rectangle.Width - Offset * 2, rectangle.Height - Offset * 2)
        Return R
    End Function
    Function Enlarge(ByVal rectangle As Rectangle, ByVal Offset As Integer) As Rectangle
        Return Enlarge(rectangle, Offset, True)
    End Function
    Function Enlarge(ByVal rectangle As Rectangle, ByVal Offset As Integer, ByVal CenterPoint As Boolean) As Rectangle
        Dim O = If(CenterPoint = True, Offset, 0)
        Dim R = New Rectangle(rectangle.X - O, rectangle.Y - O, rectangle.Width + Offset * 2, rectangle.Height + Offset * 2)
        Return R
    End Function
    Function ImageOpacity(ByVal Image As Bitmap, ByVal Opacity As Single) As Image
        Dim Result As New Bitmap(Image.Width, Image.Height, Imaging.PixelFormat.Format32bppArgb)
        With Image
            Opacity = Math.Min(Opacity, 100)
            Using Attributes As New Imaging.ImageAttributes
                Dim Matrix As New Imaging.ColorMatrix
                Matrix.Matrix33 = Opacity / 100.0F
                Attributes.SetColorMatrix(Matrix)
                Dim Points() As PointF = {New Point(0, 0), New Point(.Width, 0), New Point(0, .Height)}
                Using I As Graphics = Graphics.FromImage(Result)
                    I.Clear(Color.Transparent)
                    I.DrawImage(Image, Points, New RectangleF(Point.Empty, .Size), GraphicsUnit.Pixel, Attributes)
                End Using
            End Using
        End With
        Return Result
    End Function

#End Region

#Region " Override Methods "

    Protected Overrides Sub CreateHandle()
        MyBase.CreateHandle()
        MyBase.DoubleBuffered = True
        InvalidateCustimization()
        ColorHook()
        SizeMode = TabSizeMode.Fixed
        SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.DoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
    End Sub

    Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
        ColorHook()
        MyBase.OnHandleCreated(e)
    End Sub

    Protected Overrides Sub onmouseenter(ByVal e As System.EventArgs)
        SetState(MouseState.Over)
        MyBase.OnMouseHover(e)
    End Sub
    Protected Overrides Sub onmouseleave(ByVal e As System.EventArgs)
        SetState(MouseState.None)
        For I As Integer = 0 To TabPages.Count - 1
            If TabPages(I).DisplayRectangle.Contains(Coordinates) Then
                MyBase.Invalidate()
                Exit For
            End If
        Next
        MyBase.OnMouseHover(e)
    End Sub
    Protected Overrides Sub onmousemove(ByVal e As System.Windows.Forms.MouseEventArgs)
        Coordinates = e.Location
        For I As Integer = 0 To TabPages.Count - 1
            If TabPages(I).DisplayRectangle.Contains(Coordinates) Then
                MyBase.Invalidate()
                Exit For
            End If
        Next
        MyBase.onmousemove(e)
    End Sub
    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
        G = e.Graphics

        If Not IsNothing(_PanelColor) Then G.FillRectangle(ToBrush(_PanelColor), e.ClipRectangle)

        PaintHook()

        For I As Integer = 0 To TabPages.Count - 1
            TabPaint(I)
        Next
    End Sub

#End Region

End Class

Class Bloom

    Sub New(ByVal Name As String, ByVal Color As Color)
        _Name = Name
        _Value = Color
    End Sub
    Sub New(ByVal Name As String, ByVal Red As Integer, ByVal Green As Integer, ByVal Blue As Integer)
        _Name = Name
        _Value = Color.FromArgb(Red, Green, Blue)
    End Sub
    Sub New(ByVal Name As String, ByVal Alpha As Integer, ByVal Red As Integer, ByVal Green As Integer, ByVal Blue As Integer)
        _Name = Name
        _Value = Color.FromArgb(Alpha, Red, Green, Blue)
    End Sub

    Private _Name As String
    Public ReadOnly Property Name() As String
        Get
            Return _Name
        End Get
    End Property

    Private _Value As Color
    Public Property Color() As Color
        Get
            Return _Value
        End Get
        Set(ByVal value As Color)
            _Value = value
        End Set
    End Property

End Class



[Child Class]
Imports System.Drawing.Drawing2D

Class BlueTabControl
    Inherits TabControlDesigner

    Private C1, C2, C3, C4, C5, C6 As Color
    Private L1, L2 As LinearGradientBrush

    Sub New()
        C1 = Color.WhiteSmoke 'Panel Color
        C2 = RGB(13, 55, 110) 'Line Color
        C3 = RGB(148, 212, 255) 'Highlight
        C4 = RGB(214, 245, 255) 'Unselected Tab #1
        C5 = Color.WhiteSmoke 'Unselected Tab #2
        C6 = RGB(13, 55, 110) 'Tab Line

        Alignment = TabAlignment.Top
        Font = New Font("Verdana", 8S)
        ItemSize = New Size(130, 30)
        PanelColor = Color.Transparent

        For I As Integer = 0 To TabPages.Count - 1
            TabPages(I).BackColor = C1
        Next

    End Sub

    Protected Overrides Sub TabPaint(ByVal e As Integer)
        Dim Text = TabPages(e).Text
        Dim Tab = GetTabRect(e)
        Dim Temp As Rectangle

        Dim width As Integer = 10

        Temp = New Rectangle(Tab.X + 1, Tab.Y + 1, Tab.Width + width, Tab.Height + If(SelectedIndex = e, 1, 0))

        If e = 1 Then
            Temp = New Rectangle(Tab.X + 22, Tab.Y + 1, Tab.Width + width, Tab.Height + If(SelectedIndex = e, 1, 0))
        End If

        If e = 2 Then
            Temp = New Rectangle(Tab.X + 267, Tab.Y + 1, Tab.Width + width, Tab.Height + If(SelectedIndex = e, 1, 0))
        End If
        Dim Highlight = Temp
        Dim Outline As Point()


        Outline = New Point() {New Point(Temp.X, Temp.Bottom), New Point(Temp.X, Temp.Top), New Point(Temp.Right, Temp.Top), New Point(Temp.Right, Temp.Bottom)}


        L1 = New LinearGradientBrush(Highlight, C3, C3, 90S)
        L2 = New LinearGradientBrush(Temp, C5, C5, 90S)

        If SelectedIndex = e Then
            Try : TabPages(e).BackColor = C1 : Catch : End Try
            G.FillRectangle(ToBrush(C1), Temp)
        ElseIf State = MouseState.Over AndAlso Temp.Contains(Coordinates) Then
            G.FillRectangle(L1, Temp)
        Else
            G.FillRectangle(L2, Temp)
        End If

        Dim localFont As Font

        G.DrawLines(ToPen(C2), Outline)
        If SelectedIndex = e Then
            localFont = New Font("Verdana", 8S, FontStyle.Bold)
        Else
            localFont = New Font("Verdana", 8S, FontStyle.Regular)
        End If

        G.DrawString(Text, localFont, Brushes.Black, Center(Text, localFont, Temp, 0, 0))

    End Sub


    Protected Overrides Sub PaintHook()
        Dim Outline = New Point() {New Point(ClientRectangle.X + 3, ClientRectangle.Y + 34), _
                                   New Point(ClientRectangle.X + 3, ClientRectangle.Bottom - 4), _
                                   New Point(ClientRectangle.Right - 4, ClientRectangle.Bottom - 4), _
                                   New Point(ClientRectangle.Right - 4, ClientRectangle.Top + 34)}
        G.DrawLines(ToPen(C6), Outline)
        G.DrawLine(ToPen(C6), 4, 33, Width - 4, 33)
    End Sub


    Protected Overrides Sub ColorHook()

    End Sub

    Private Sub InitializeComponent()
        Me.SuspendLayout()
        '
        'BlueTabControl
        '
        Me.Colors = New ResourcesManagement.Bloom(-1) {}
        Me.ResumeLayout(False)

    End Sub

End Class



I have been playing with the TabPaint method of the BlueTabControl. The issues I am having are:

- I am not sure how to position my tabs properly. Right now, I am adding a bunch to the .X with hardcoded values. The highlight is not working for the far right tab.

- I am not sure how to set the width of them without messing everything up.

These two things are the only things I am confused about. If you have a better tab control that allows flat looking tabs that you can set the color and size of, PLEASE link it. This is for a project at work that is due asap.

Thanks,
Cy

This post has been edited by modi123_1: 02 July 2013 - 10:29 AM
Reason for edit:: added image tags


Is This A Good Question/Topic? 0
  • +

Replies To: VB.NET Tab Control Problems

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8954
  • View blog
  • Posts: 33,569
  • Joined: 12-June 08

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 11:15 AM

I see you are butchering Eprouvez's code from a year or so back. Interesting.

Let's step back and ask _why_ you need to make this by hand? Why not investigate a third party tab control and see if they have what you need? Maybe something from infragistics? Magic TabControl? ComponentFactory? Why this specific design? Why custom?

Quote

- I am not sure how to position my tabs properly. Right now, I am adding a bunch to the .X with hardcoded values. The highlight is not working for the far right tab.

- I am not sure how to set the width of them without messing everything up.

These two things are the only things I am confused about. If you have a better tab control that allows flat looking tabs that you can set the color and size of, PLEASE link it.

You need to work more with the onpaint, and abstract your thinking. If you need lengths and widths then the tab container should provide that.. Making complex GUI controls is not a simple endeavor. If it were up to me I would have made my own tab page controls, jacked with how their tabs draw, their shape, etc.. then made my tab container and have it set the tabs a specific width based on a factor of how big the whole control is.

Quote

This is for a project at work that is due asap.

Well that's a bummer.
Was This Post Helpful? 0
  • +
  • -

#3 cycangfx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-July 13

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 11:43 AM

View Postmodi123_1, on 02 July 2013 - 11:15 AM, said:

I see you are butchering Eprouvez's code from a year or so back. Interesting.

Let's step back and ask _why_ you need to make this by hand? Why not investigate a third party tab control and see if they have what you need? Maybe something from infragistics? Magic TabControl? ComponentFactory? Why this specific design? Why custom?


I am all for using a control that does all this. But I haven't found one. I haven't found a tab control that gives flat square tabs. That's all I am looking for.

None of the ones you mentioned do what I require.

The reason I'd like this specific design is because I'm going for a clean UI, and this one really appealed to my users.

Quote

You need to work more with the onpaint, and abstract your thinking. If you need lengths and widths then the tab container should provide that.. Making complex GUI controls is not a simple endeavor. If it were up to me I would have made my own tab page controls, jacked with how their tabs draw, their shape, etc.. then made my tab container and have it set the tabs a specific width based on a factor of how big the whole control is.


What do you mean when you say tab container? And how would I go about changing their shape?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8954
  • View blog
  • Posts: 33,569
  • Joined: 12-June 08

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 11:54 AM

You can either try to reskin the current GUIs or just write your own.

As for those examples - yeah, most do allow you to 'style' their tabs. Infragistics did allow as much a few years back.


Quote

What do you mean when you say tab container?

When you plunk a 'tab GUI' onto a form it has two parts.. the individual tab pages and the entire tab control/container that houses said pages.

Quote

And how would I go about changing their shape?

Override the tab page's draw... so it draws a square..
Was This Post Helpful? 0
  • +
  • -

#5 cycangfx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-July 13

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 12:41 PM

View Postmodi123_1, on 02 July 2013 - 11:54 AM, said:

You can either try to reskin the current GUIs or just write your own.

As for those examples - yeah, most do allow you to 'style' their tabs. Infragistics did allow as much a few years back.


Quote

What do you mean when you say tab container?

When you plunk a 'tab GUI' onto a form it has two parts.. the individual tab pages and the entire tab control/container that houses said pages.

Quote

And how would I go about changing their shape?

Override the tab page's draw... so it draws a square..

Can you help me with the current code?
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8954
  • View blog
  • Posts: 33,569
  • Joined: 12-June 08

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 12:45 PM

Ah... no. I do not believe I am going to rewrite your existing code for you. Come on - it is totally do-able!
Was This Post Helpful? 0
  • +
  • -

#7 cycangfx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-July 13

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 12:50 PM

View Postmodi123_1, on 02 July 2013 - 12:45 PM, said:

Ah... no. I do not believe I am going to rewrite your existing code for you. Come on - it is totally do-able!


I wasn't asking you to rewrite my code for me. I was asking for you to explain or elaborate a bit more on what I need to do and how I should go about doing it.

I was wondering if I could fix stuff within the code I have currently. But there are things in it that I don't understand, so I wanted to ask someone more experienced if they understood it.

This is what I understood so far:

- Drop a tabcontrol
- Override it's paint method
- Some how draw a square for the tab instead of the normal rectangle
- Paint is white

I'm still unsure on how I would align one tab to the far right or if that's even possible.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8954
  • View blog
  • Posts: 33,569
  • Joined: 12-June 08

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 12:56 PM

Quote

I wasn't asking you to rewrite my code for me. I was asking for you to explain or elaborate a bit more on what I need to do and how I should go about doing it.

For the love of St. Monica - you want me to write you a tutorial? I already wrote a styling guide, but if you expect me to write a style guide for everyone's minute and infinite changes for any GUI object then you are very much mistaken.

Come on broseph/ine! This is that whole "step into the bush", "head yonder into uncharted territory", and think for yourself. I am unsure what programming you have done up until now, but let me tell you - there is a whole wide world off the reservation of "what is known" when you try to mash two (or more) things together. Sure you may try to lash jello to a stick and sure it didn't quite turn out to be a tactical hatchet, but darn it you tried and you have a better idea what to do!

Quote

I'm still unsure on how I would align one tab to the far right or if that's even possible.

You are overriding the paint method so you can tell it to paint where ever the heck you want! The freedom is yours!
Was This Post Helpful? 0
  • +
  • -

#9 cycangfx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-July 13

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 01:00 PM

View Postmodi123_1, on 02 July 2013 - 12:56 PM, said:

Quote

I wasn't asking you to rewrite my code for me. I was asking for you to explain or elaborate a bit more on what I need to do and how I should go about doing it.

For the love of St. Monica - you want me to write you a tutorial? I already wrote a styling guide, but if you expect me to write a style guide for everyone's minute and infinite changes for any GUI object then you are very much mistaken.

Come on broseph/ine! This is that whole "step into the bush", "head yonder into uncharted territory", and think for yourself. I am unsure what programming you have done up until now, but let me tell you - there is a whole wide world off the reservation of "what is known" when you try to mash two (or more) things together. Sure you may try to lash jello to a stick and sure it didn't quite turn out to be a tactical hatchet, but darn it you tried and you have a better idea what to do!

Quote

I'm still unsure on how I would align one tab to the far right or if that's even possible.

You are overriding the paint method so you can tell it to paint where ever the heck you want! The freedom is yours!


Your styling guide shows how to do pretty much basic stuff.

All you have told me up till now is stuff that I can google and which is obvious. Yes, I am experimenting with drawing, but it would be nice if someone could provide guidance. It's obvious you can't, so I won't ask you anymore.

Thanks.
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8954
  • View blog
  • Posts: 33,569
  • Joined: 12-June 08

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 01:11 PM

Quote

Your styling guide shows how to do pretty much basic stuff.

Yeah.. and what do you think you are asking to do? Extrapolate to what you need.

Quote

All you have told me up till now is stuff that I can google and which is obvious. Yes, I am experimenting with drawing, but it would be nice if someone could provide guidance. It's obvious you can't, so I won't ask you anymore.

Thanks.

You want a tutorial.. written out.. step by step. Great. I'll get right on that after about a hundred other things.. or.. OR.. you can stop and think about what you are doing.

Your current control has a background you don't want.. okay.. turn it off. Now you need to figure out what to draw when the 'on paint' event fires. Hmm.. well you *COULD* feed it a squared off image, but heck.. that might be silly. What to do when a tab is active? Perhaps change its custom drawn tab image to something else! Huzzah! How does one draw a bitmap object on the screen? Can I draw it where ever I want? Sure! If I don't have the confines of the existing background and such I don't really need to be confined with where things were drawn I can specify that myself! Though - you'll need to redo that tab page's "on paint" so you can draw the tabs where ever you feel like.

So.. don't get fussy with me because there isn't a giant bright light, hand held guided tour of what ever crazy UI thing you think you want to do with what ever code you happened to grub off the net. That would just be silly to expect one, but with everything folks have told you here.. with what was in the original code you ganked... and a few minutes critical thought you can totally accomplish this!

You might need a break (if you've been working on bashing your head with this), and get some fresh eyes and 'tude.. but trust me it is all there.
Was This Post Helpful? 0
  • +
  • -

#11 cycangfx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-July 13

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 04:05 PM

View Postmodi123_1, on 02 July 2013 - 01:11 PM, said:

Quote

Your styling guide shows how to do pretty much basic stuff.

Yeah.. and what do you think you are asking to do? Extrapolate to what you need.

Quote

All you have told me up till now is stuff that I can google and which is obvious. Yes, I am experimenting with drawing, but it would be nice if someone could provide guidance. It's obvious you can't, so I won't ask you anymore.

Thanks.

You want a tutorial.. written out.. step by step. Great. I'll get right on that after about a hundred other things.. or.. OR.. you can stop and think about what you are doing.

Your current control has a background you don't want.. okay.. turn it off. Now you need to figure out what to draw when the 'on paint' event fires. Hmm.. well you *COULD* feed it a squared off image, but heck.. that might be silly. What to do when a tab is active? Perhaps change its custom drawn tab image to something else! Huzzah! How does one draw a bitmap object on the screen? Can I draw it where ever I want? Sure! If I don't have the confines of the existing background and such I don't really need to be confined with where things were drawn I can specify that myself! Though - you'll need to redo that tab page's "on paint" so you can draw the tabs where ever you feel like.

So.. don't get fussy with me because there isn't a giant bright light, hand held guided tour of what ever crazy UI thing you think you want to do with what ever code you happened to grub off the net. That would just be silly to expect one, but with everything folks have told you here.. with what was in the original code you ganked... and a few minutes critical thought you can totally accomplish this!

You might need a break (if you've been working on bashing your head with this), and get some fresh eyes and 'tude.. but trust me it is all there.


Yes, I was expecting a tutorial of showing how a general paint works, not for my scenario in particular. But after, I was just asking for some guidance. I dunno if you've ever been through any sort of schooling, but usually 'guidance' refers to 'Look at here for some tips. You should probably try looking at -that- and try doing -this'.

You have been very rude from the get go. You have good suggestions, but have very poor communication skills. You shouldn't be bashing other people's work. This forum is to help them.

You also make far too many assumptions.

However, thanks for your help so far.
Was This Post Helpful? 0
  • +
  • -

#12 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8954
  • View blog
  • Posts: 33,569
  • Joined: 12-June 08

Re: VB.NET Tab Control Problems

Posted 02 July 2013 - 05:18 PM

You are welcome. Good luck!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1