ScrollBarRenderer.GetThumbGripSize(Graphics, ScrollBarState) 方法

定义

返回滚动框手柄的大小。Returns the size of the scroll box grip.

public:
 static System::Drawing::Size GetThumbGripSize(System::Drawing::Graphics ^ g, System::Windows::Forms::VisualStyles::ScrollBarState state);
public static System.Drawing.Size GetThumbGripSize (System.Drawing.Graphics g, System.Windows.Forms.VisualStyles.ScrollBarState state);
static member GetThumbGripSize : System.Drawing.Graphics * System.Windows.Forms.VisualStyles.ScrollBarState -> System.Drawing.Size
Public Shared Function GetThumbGripSize (g As Graphics, state As ScrollBarState) As Size

参数

g
Graphics

此操作将使用的 GraphicsThe Graphics this operation will use.

state
ScrollBarState

ScrollBarState 值之一,指定滚动框手柄的可视状态。One of the ScrollBarState values that specifies the visual state of the scroll box grip.

返回

指定滚动框手柄大小的 SizeA Size that specifies the size of the scroll box grip.

例外

操作系统不支持视觉样式。The operating system does not support visual styles.

-or-

用户在操作系统中禁用视觉样式。Visual styles are disabled by the user in the operating system.

-or-

视觉样式不应用于应用程序窗口的工作区。Visual styles are not applied to the client area of application windows.

注解

滚动框手柄的大小取决于操作系统的当前视觉样式。The size of the scroll box grip is determined by the current visual style of the operating system.

使用此方法之前, 应验证IsSupported属性是否返回。 trueBefore using this method, you should verify that the IsSupported property returns true.

适用于