VisualStyleElement.Status.Gripper 类

定义

为状态栏的手柄提供 VisualStyleElementProvides a VisualStyleElement for the grip of the status bar. 此类不能被继承。This class cannot be inherited.

public: ref class VisualStyleElement::Status::Gripper abstract sealed
public static class VisualStyleElement.Status.Gripper
type VisualStyleElement.Status.Gripper = class
Public Class VisualStyleElement.Status.Gripper
继承
VisualStyleElement.Status.Gripper

示例

下面的代码示例演示如何VisualStyleRenderer使用Normal属性返回的VisualStyleElement来创建。The following code example demonstrates how to create a VisualStyleRenderer with the VisualStyleElement returned by the Normal property. 若要运行此示例, 请将其粘贴到 Windows 窗体中。To run this example, paste it into a Windows Form. 处理窗体的Paint事件, 并从DrawVisualStyleElementStatusGripper1事件处理方法Paint调用方法, 并将作为e PaintEventArgs传递。Handle the form's Paint event and call the DrawVisualStyleElementStatusGripper1 method from the Paint event-handling method, passing e as PaintEventArgs.

public void DrawVisualStyleElementStatusGripper1(PaintEventArgs e)
{
    if (VisualStyleRenderer.IsElementDefined(
        VisualStyleElement.Status.Gripper.Normal))
    {
        VisualStyleRenderer renderer =
             new VisualStyleRenderer(VisualStyleElement.Status.Gripper.Normal);
        Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
        renderer.DrawBackground(e.Graphics, rectangle1);
        e.Graphics.DrawString("VisualStyleElement.Status.Gripper.Normal",
             this.Font, Brushes.Black, new Point(10, 10));
    }
    else
        e.Graphics.DrawString("This element is not defined in the current visual style.",
             this.Font, Brushes.Black, new Point(10, 10));
}
Public Sub DrawVisualStyleElementStatusGripper1(ByVal e As PaintEventArgs)
    If (VisualStyleRenderer.IsElementDefined( _
     VisualStyleElement.Status.Gripper.Normal)) Then
        Dim renderer As New VisualStyleRenderer _
          (VisualStyleElement.Status.Gripper.Normal)
        Dim rectangle1 As New Rectangle(10, 50, 50, 50)
        renderer.DrawBackground(e.Graphics, rectangle1)
        e.Graphics.DrawString("VisualStyleElement.Status.Gripper.Normal", _
          Me.Font, Brushes.Black, New Point(10, 10))
    Else
        e.Graphics.DrawString("This element is not defined in the current visual style.", _
          Me.Font, Brushes.Black, New Point(10, 10))
    End If
End Sub

注解

VisualStyleElement.Status.GripperNormal的属性返回VisualStyleElement表示状态栏手柄的。The Normal property of the VisualStyleElement.Status.Gripper class returns a VisualStyleElement that represents the status bar grip.

属性

Normal

获取表示状态栏手柄的视觉样式元素。Gets a visual style element that represents the status bar grip.

适用于

另请参阅