GroupBoxRenderer.DrawGroupBox メソッド

定義

グループ ボックス コントロールを描画します。

オーバーロード

名前 説明
DrawGroupBox(Graphics, Rectangle, GroupBoxState)

グループ ボックス コントロールを指定した状態と境界に描画します。

DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState)

指定したテキストとフォントを使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

DrawGroupBox(Graphics, Rectangle, String, Font, Color, GroupBoxState)

指定したテキスト、フォント、色を使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

DrawGroupBox(Graphics, Rectangle, String, Font, TextFormatFlags, GroupBoxState)

指定したテキスト、フォント、およびテキストの書式設定を使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

DrawGroupBox(Graphics, Rectangle, String, Font, Color, TextFormatFlags, GroupBoxState)

指定したテキスト、フォント、色、およびテキストの書式設定を使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

DrawGroupBox(Graphics, Rectangle, GroupBoxState)

グループ ボックス コントロールを指定した状態と境界に描画します。

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, state As GroupBoxState)

パラメーター

g
Graphics

グループ ボックスの描画に使用する Graphics

bounds
Rectangle

グループ ボックスの境界を指定する Rectangle

state
GroupBoxState

グループ ボックスの表示状態を指定する GroupBoxState 値の 1 つ。

次のコード例では、カスタム コントロールのOnPaint メソッドのDrawGroupBox(Graphics, Rectangle, GroupBoxState) メソッドを使用して、二重の境界線を持つグループ ボックスを描画します。 このコード例は、 GroupBoxRenderer クラスに提供されるより大きな例の一部です。

    // Draw the group box in the current state.
protected:
    virtual void OnPaint(PaintEventArgs^ e) override 
    {
        __super::OnPaint(e);

        GroupBoxRenderer::DrawGroupBox(e->Graphics, ClientRectangle,
            this->Text, this->Font, state);

        // Draw an additional inner border if visual styles are enabled.
        if (Application::RenderWithVisualStyles)
        {
            GroupBoxRenderer::DrawGroupBox(e->Graphics, innerRectangle,
                state);
        }
    }
// Draw the group box in the current state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle,
        this.Text, this.Font, state);

    // Draw an additional inner border if visual styles are enabled.
    if (Application.RenderWithVisualStyles)
    {
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state);
    }
}
' Draw the group box in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 
    MyBase.OnPaint(e)
    
    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle, Me.Text, Me.Font, state)
    
    ' Draw an additional inner border if visual styles are enabled.
    If Application.RenderWithVisualStyles Then
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state)
    End If

End Sub

注釈

オペレーティング システムでビジュアル スタイルが有効になっていて、visual スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドはクラシック Windows スタイルでグループ ボックスを描画します。

適用対象

DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState)

指定したテキストとフォントを使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, state As GroupBoxState)

パラメーター

g
Graphics

グループ ボックスの描画に使用する Graphics

bounds
Rectangle

グループ ボックスの境界を指定する Rectangle

groupBoxText
String

グループ ボックスで描画する String

font
Font

Fontに適用するgroupBoxText

state
GroupBoxState

グループ ボックスの表示状態を指定する GroupBoxState 値の 1 つ。

次のコード例では、カスタム コントロールのOnPaint メソッドのDrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState) メソッドを使用して、二重の境界線を持つグループ ボックスを描画します。 このコード例は、 GroupBoxRenderer クラスに提供されるより大きな例の一部です。

    // Draw the group box in the current state.
protected:
    virtual void OnPaint(PaintEventArgs^ e) override 
    {
        __super::OnPaint(e);

        GroupBoxRenderer::DrawGroupBox(e->Graphics, ClientRectangle,
            this->Text, this->Font, state);

        // Draw an additional inner border if visual styles are enabled.
        if (Application::RenderWithVisualStyles)
        {
            GroupBoxRenderer::DrawGroupBox(e->Graphics, innerRectangle,
                state);
        }
    }
// Draw the group box in the current state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle,
        this.Text, this.Font, state);

    // Draw an additional inner border if visual styles are enabled.
    if (Application.RenderWithVisualStyles)
    {
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state);
    }
}
' Draw the group box in the current state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 
    MyBase.OnPaint(e)
    
    GroupBoxRenderer.DrawGroupBox(e.Graphics, ClientRectangle, Me.Text, Me.Font, state)
    
    ' Draw an additional inner border if visual styles are enabled.
    If Application.RenderWithVisualStyles Then
        GroupBoxRenderer.DrawGroupBox(e.Graphics, innerRectangle, state)
    End If

End Sub

注釈

オペレーティング システムでビジュアル スタイルが有効になっていて、visual スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドはクラシック Windows スタイルでグループ ボックスを描画します。

適用対象

DrawGroupBox(Graphics, Rectangle, String, Font, Color, GroupBoxState)

指定したテキスト、フォント、色を使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Drawing::Color textColor, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Drawing.Color textColor, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Drawing.Color * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, textColor As Color, state As GroupBoxState)

パラメーター

g
Graphics

グループ ボックスの描画に使用する Graphics

bounds
Rectangle

グループ ボックスの境界を指定する Rectangle

groupBoxText
String

グループ ボックスで描画する String

font
Font

Fontに適用するgroupBoxText

textColor
Color

Colorに適用するgroupBoxText

state
GroupBoxState

グループ ボックスの表示状態を指定する GroupBoxState 値の 1 つ。

注釈

オペレーティング システムでビジュアル スタイルが有効になっていて、visual スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドはクラシック Windows スタイルでグループ ボックスを描画します。

適用対象

DrawGroupBox(Graphics, Rectangle, String, Font, TextFormatFlags, GroupBoxState)

指定したテキスト、フォント、およびテキストの書式設定を使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Windows::Forms::TextFormatFlags flags, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Windows.Forms.TextFormatFlags flags, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Windows.Forms.TextFormatFlags * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, flags As TextFormatFlags, state As GroupBoxState)

パラメーター

g
Graphics

グループ ボックスの描画に使用する Graphics

bounds
Rectangle

グループ ボックスの境界を指定する Rectangle

groupBoxText
String

グループ ボックスで描画する String

font
Font

Fontに適用するgroupBoxText

flags
TextFormatFlags

TextFormatFlags値のビットごとの組み合わせ。

state
GroupBoxState

グループ ボックスの表示状態を指定する GroupBoxState 値の 1 つ。

注釈

オペレーティング システムでビジュアル スタイルが有効になっていて、visual スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドはクラシック Windows スタイルでグループ ボックスを描画します。

適用対象

DrawGroupBox(Graphics, Rectangle, String, Font, Color, TextFormatFlags, GroupBoxState)

指定したテキスト、フォント、色、およびテキストの書式設定を使用して、指定した状態と境界内にグループ ボックス コントロールを描画します。

public:
 static void DrawGroupBox(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ groupBoxText, System::Drawing::Font ^ font, System::Drawing::Color textColor, System::Windows::Forms::TextFormatFlags flags, System::Windows::Forms::VisualStyles::GroupBoxState state);
public static void DrawGroupBox(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string groupBoxText, System.Drawing.Font font, System.Drawing.Color textColor, System.Windows.Forms.TextFormatFlags flags, System.Windows.Forms.VisualStyles.GroupBoxState state);
static member DrawGroupBox : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Font * System.Drawing.Color * System.Windows.Forms.TextFormatFlags * System.Windows.Forms.VisualStyles.GroupBoxState -> unit
Public Shared Sub DrawGroupBox (g As Graphics, bounds As Rectangle, groupBoxText As String, font As Font, textColor As Color, flags As TextFormatFlags, state As GroupBoxState)

パラメーター

g
Graphics

グループ ボックスの描画に使用する Graphics

bounds
Rectangle

グループ ボックスの境界を指定する Rectangle

groupBoxText
String

グループ ボックスで描画する String

font
Font

Fontに適用するgroupBoxText

textColor
Color

Colorに適用するgroupBoxText

flags
TextFormatFlags

TextFormatFlags値のビットごとの組み合わせ。

state
GroupBoxState

グループ ボックスの表示状態を指定する GroupBoxState 値の 1 つ。

注釈

オペレーティング システムでビジュアル スタイルが有効になっていて、visual スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドはクラシック Windows スタイルでグループ ボックスを描画します。

適用対象