本文整理汇总了VB.NET中System.Windows.Forms.TrackBarRenderer.GetTopPointingThumbSize方法的典型用法代码示例。如果您正苦于以下问题:VB.NET TrackBarRenderer.GetTopPointingThumbSize方法的具体用法?VB.NET TrackBarRenderer.GetTopPointingThumbSize怎么用?VB.NET TrackBarRenderer.GetTopPointingThumbSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TrackBarRenderer
的用法示例。
在下文中一共展示了TrackBarRenderer.GetTopPointingThumbSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SetupTrackBar
' Calculate the sizes of the bar, thumb, and ticks rectangle.
Private Sub SetupTrackBar()
If Not TrackBarRenderer.IsSupported Then
Return
End If
Using g As Graphics = Me.CreateGraphics()
' Calculate the size of the track bar.
trackRectangle.X = ClientRectangle.X + 2
trackRectangle.Y = ClientRectangle.Y + 28
trackRectangle.Width = ClientRectangle.Width - 4
trackRectangle.Height = 4
' Calculate the size of the rectangle in which to
' draw the ticks.
ticksRectangle.X = trackRectangle.X + 4
ticksRectangle.Y = trackRectangle.Y - 8
ticksRectangle.Width = trackRectangle.Width - 8
ticksRectangle.Height = 4
tickSpace = (CSng(ticksRectangle.Width) - 1) / _
(CSng(numberTicks) - 1)
' Calculate the size of the thumb.
thumbRectangle.Size = _
TrackBarRenderer.GetTopPointingThumbSize( _
g, TrackBarThumbState.Normal)
thumbRectangle.X = CurrentTickXCoordinate()
thumbRectangle.Y = trackRectangle.Y - 8
End Using
End Sub