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 つ。

次のコード例では、 DrawGroupBox(Graphics, Rectangle, GroupBoxState) カスタム コントロールの OnPaint メソッドの メソッドを使用して、2 つの境界線を持つグループ ボックスを描画します。 このコード例は、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

注釈

オペレーティング システムでビジュアル スタイルが有効になっており、ビジュアル スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドは従来の 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);
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

groupBoxText に適用する Font

state
GroupBoxState

グループ ボックスのビジュアル状態を指定する GroupBoxState 値の 1 つ。

次のコード例では、 DrawGroupBox(Graphics, Rectangle, String, Font, GroupBoxState) カスタム コントロールの OnPaint メソッドの メソッドを使用して、2 つの境界線を持つグループ ボックスを描画します。 このコード例は、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

注釈

オペレーティング システムでビジュアル スタイルが有効になっており、ビジュアル スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドは従来の 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);
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

groupBoxText に適用する Font

textColor
Color

groupBoxText に適用する Color

state
GroupBoxState

グループ ボックスのビジュアル状態を指定する GroupBoxState 値の 1 つ。

注釈

オペレーティング システムでビジュアル スタイルが有効になっており、ビジュアル スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドは従来の 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);
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

groupBoxText に適用する Font

flags
TextFormatFlags

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

state
GroupBoxState

グループ ボックスのビジュアル状態を指定する GroupBoxState 値の 1 つ。

注釈

オペレーティング システムでビジュアル スタイルが有効になっており、ビジュアル スタイルが現在のアプリケーションに適用されている場合、このメソッドは現在の表示スタイルでグループ ボックスを描画します。 それ以外の場合、このメソッドは従来の 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);
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

groupBoxText に適用する Font

textColor
Color

groupBoxText に適用する Color

flags
TextFormatFlags

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

state
GroupBoxState

グループ ボックスのビジュアル状態を指定する GroupBoxState 値の 1 つ。

注釈

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

適用対象