TrackBarRenderer.GetTopPointingThumbSize メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Shared Function GetTopPointingThumbSize ( _ g As Graphics, _ state As TrackBarThumbState _ ) As Size
Dim g As Graphics Dim state As TrackBarThumbState Dim returnValue As Size returnValue = TrackBarRenderer.GetTopPointingThumbSize(g, state)
戻り値
スライダのサイズをピクセル単位で指定する Size。



GetTopPointingThumbSize メソッドを使用して、DrawTopPointingThumb メソッドがスライダを描画するときに使用する四角形のサイズを確認するコード例を、次に示します。このコード例は、TrackBarRenderer クラスのトピックで取り上げているコード例の一部分です。
' 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
// 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; } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からTrackBarRenderer.GetTopPointingThumbSize メソッドを検索する場合は、下記のリンクをクリックしてください。

- TrackBarRenderer.GetTopPointingThumbSize メソッドのページへのリンク