带有当前标签页三角形的 TabControl
TabControl with current tabpage triangle
我需要修改我在网上找到的这个tabcontrol,如果我改变项目高度,triable不能正确调整
绘图的代码是
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)
我已经对 New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14)
行进行了调整,但没有成功。
如果调整大小,比如 3 点,我需要三角形,虽然更大并且在 Tabpage 矩形中居中。
任何想法
经过进一步修补,我找到了解决方案
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)}
我需要修改我在网上找到的这个tabcontrol,如果我改变项目高度,triable不能正确调整
绘图的代码是
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)
我已经对 New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14)
行进行了调整,但没有成功。
如果调整大小,比如 3 点,我需要三角形,虽然更大并且在 Tabpage 矩形中居中。
任何想法
经过进一步修补,我找到了解决方案
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)}