Results 1 to 15 of 15

Thread: tabcontrol tab color.... [twice resolved]

Threaded View

  1. #7

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: tabcontrol tab color....

    Quote Originally Posted by RobDog888
    Ah, not the actual tabs but the blank area. How about drawing over it using the Graphics namespace? Since it probably doesnt
    move or resize it should be easy to cover it with a color or gradient you want.
    I have worked on it, but don't see why it doesn't work. using mouse move events, it appears the the blank region is part of the form (at least it responds to form events so I have tried this code
    VB Code:
    1. Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
    2.  
    3.         Dim fb As New SolidBrush(Color.Black) 'Me.BackColor)
    4.         Dim LastTabRect As Rectangle = TabControl1.GetTabRect(TabControl1.TabPages.Count - 1)
    5.         Dim Rect As Rectangle
    6.  
    7.         Rect.Location = New Point(LastTabRect.Right + TabControl1.Left, TabControl1.Top)
    8.         Rect.Size = New Size(TabControl1.Right - Rect.Left, LastTabRect.Height)
    9.         e.Graphics.FillRectangle(fb, Rect)
    10.  
    11.         fb.Dispose()
    12.  
    13.         Label2.Text = "rect location = " & Rect.X & ", " & Rect.Y & ", Size = " & Rect.Width & ", " & Rect.Height
    14.     End Sub
    based on the mousemove feedback, the rectanlge looks like it's in the right spot, but it doesn't paint over the blank area. Can you see what's wrong? Maybe I'm painting on the wrong object?
    here's the project too.
    thanks
    kevin
    Attached Files Attached Files
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width