本文整理汇总了C#中System.Windows.Forms.TrackBarRenderer.GetTopPointingThumbSize方法的典型用法代码示例。如果您正苦于以下问题:C# TrackBarRenderer.GetTopPointingThumbSize方法的具体用法?C# TrackBarRenderer.GetTopPointingThumbSize怎么用?C# TrackBarRenderer.GetTopPointingThumbSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TrackBarRenderer
的用法示例。
在下文中一共展示了TrackBarRenderer.GetTopPointingThumbSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupTrackBar
// Calculate the sizes of the bar, thumb, and ticks rectangle.
private void SetupTrackBar()
{
if (!TrackBarRenderer.IsSupported)
return;
using (Graphics g = this.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 = ((float)ticksRectangle.Width - 1) /
((float)numberTicks - 1);
// Calculate the size of the thumb.
thumbRectangle.Size =
TrackBarRenderer.GetTopPointingThumbSize(g,
TrackBarThumbState.Normal);
thumbRectangle.X = CurrentTickXCoordinate();
thumbRectangle.Y = trackRectangle.Y - 8;
}
}