TabControl with current tabpage triangle

65 views Asked by At

I need to modify this tabcontrol i found online, if i change the item height, the triable does not adjust properly

enter image description here

The code doing the drawing is

G.SmoothingMode = SmoothingMode.HighQuality
                Dim p() As Point = {New Point(ItemSize.Height - 3, GetTabRect(i).Location.Y + 20), _
                           New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14), _
                           New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 28)}
     G.FillPolygon(Brushes.White, p)
     G.DrawPolygon(New Pen(Color.FromArgb(170, 187, 204)), p)

I have made adjustments to the line New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14) without success.

i need the triangle albeit bigger and centered in the Tabpage rectangle if the size is adjusted, say by 3 points.

Any ideas

1

There are 1 answers

4
Smith On BEST ANSWER

I was able to find a solution after futher tinkering

 Dim hlf As Integer = GetTabRect(i).Height \ 2
G.SmoothingMode = SmoothingMode.HighQuality
            Dim p() As Point = {New Point(ItemSize.Height - 6, GetTabRect(i).Location.Y + hlf), _
      New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + hlf - 7), _
      New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + hlf + 7)}