BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
'DrawItem event of TabControlAdv Private Sub tabControlAdv1_DrawItem(ByVal sender As Object, ByVal drawItemInfo As Syncfusion.Windows.Forms.Tools.DrawTabEventArgs)
Dim lgb As LinearGradientBrush ' Use LinearGradientBrush to set gradient. ' Use GetTabRect to get the rectangle of the tabs. If drawItemInfo.Index <> Me.tabControlAdv1.SelectedIndex Then ' For the non-selected tabs lgb = New System.Drawing.Drawing2D.LinearGradientBrush(Me.tabControlAdv1.GetTabRect(drawItemInfo.Index), Color.FromArgb(197, 197, 173), Color.FromArgb(228, 228, 212), LinearGradientMode.Horizontal) Else ' For the selected tab lgb = New System.Drawing.Drawing2D.LinearGradientBrush(Me.tabControlAdv1.GetTabRect(drawItemInfo.Index), Color.White, Color.WhiteSmoke, LinearGradientMode.Horizontal) End If Dim positions() As Single = { 0.0f, 0.05f, 0.95f, 1.0f } Dim factors() As Single = { 0.4f, 1.0f, 0.05f, 0.04f } ' Blend settings Dim blend As New Blend() blend.Factors = factors blend.Positions = positions lgb.Blend = blend drawItemInfo.Graphics.FillRectangle(lgb, Me.tabControlAdv1.GetTabRect(drawItemInfo.Index)) lgb.Dispose() ' Draw the default borders and interior (text and image) drawItemInfo.DrawBorders()
drawItemInfo.Graphics.DrawString(Me.tabControlAdv1.TabPages(drawItemInfo.Index).Text, drawItemInfo.Font, Brushes.Black, drawItemInfo.Bounds.X + 5, drawItemInfo.Bounds.Y + 5) CloseButton = New Rectangle(drawItemInfo.Bounds.X + drawItemInfo.Bounds.Width - 15, drawItemInfo.Bounds.Y + 6, 10, 10) drawItemInfo.Graphics.DrawLine(New Pen(Brushes.Black), New Point(CloseButton.X,CloseButton.Y), New Point(CloseButton.X+ CloseButton.Width, CloseButton.Y+CloseButton.Height)) drawItemInfo.Graphics.DrawLine(New Pen(Brushes.Black), New Point(CloseButton.X, CloseButton.Y+CloseButton.Height), New Point(CloseButton.X + CloseButton.Width, CloseButton.Y)) drawItemInfo.Graphics.DrawRectangle(New Pen(Brushes.Black), CloseButton) |