[英]TabControl with current tabpage triangle
I need to modify this tabcontrol i found online, if i change the item height, the triable does not adjust properly 我需要修改我在网上找到的tabcontrol,如果我更改商品的高度,则Triable无法正确调整
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. 我已经对
New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14)
行进行了调整,但没有成功。
i need the triangle albeit bigger and centered in the Tabpage rectangle if the size is adjusted, say by 3 points. 我需要一个三角形,尽管更大,并在Tabpage矩形中居中(如果调整了尺寸,例如3点)。
Any ideas 有任何想法吗
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)}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.