Hi Steve,
Thank you for your prompt reply!
To get what you want, you need to get the rectangle representing the
TabControl's header strip first and then create a GraphicsPath object. Add
the header strip rectangle and all the tab rectangles to the GraphicsPath
object. Then fill the GraphicsPath object with the color you want. By
default, the FillMode property of a GraphicsPath is Alternate, which means
the overlap is subtractive.
The following is a sample:
Private Sub TabControl1_DrawItem(ByVal sender As Object, ByVal e As
System.Windows.Forms.DrawItemEventArgs) Handles TabControl1.DrawItem
' rectange representing the TabControl's header strip
Dim header_rect As New Rectangle(TabControl1.ClientRectangle.X,
tab_rect.Y, TabControl1.ClientRectangle.Width, tab_rect.Height)
Dim path As New GraphicsPath()
path.AddRectangle(header_rect)
For i As Integer = 0 To TabControl1.TabCount - 1
path.AddRectangle(TabControl1.GetTabRect(i))
Next
e.Graphics.FillPath(Brushes.Yellow, path)
End Sub
Hope this helps.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.