CheckBoxRenderer.GetGlyphSize メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CheckBoxRenderer.GetGlyphSize メソッドの意味・解説 

CheckBoxRenderer.GetGlyphSize メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

チェック ボックスグリフサイズ返します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Shared Function GetGlyphSize
 ( _
    g As Graphics, _
    state As CheckBoxState _
) As Size
Dim g As Graphics
Dim state As CheckBoxState
Dim returnValue As Size

returnValue = CheckBoxRenderer.GetGlyphSize(g, state)
public static Size GetGlyphSize (
    Graphics g,
    CheckBoxState state
)
public:
static Size GetGlyphSize (
    Graphics^ g, 
    CheckBoxState state
)
public static Size GetGlyphSize (
    Graphics g, 
    CheckBoxState state
)
public static function GetGlyphSize
 (
    g : Graphics, 
    state : CheckBoxState
) : Size

パラメータ

g

この操作使用される Graphics

state

チェック ボックスビジュアル状態を指定する CheckBoxState 値の 1 つ

戻り値
チェック ボックスグリフ大きさを表す Size

解説解説
使用例使用例

GetGlyphSize メソッド使用してチェック ボックステキスト境界決定するコード例次に示します。このコード例は、CheckBoxRenderer クラストピック取り上げているコード例一部分です。

' Calculate the text bounds, exluding the check box.
Public ReadOnly Property
 TextRectangle() As Rectangle
    Get
        Using g As Graphics = Me.CreateGraphics()
            With textRectangleValue
                .X = Me.ClientRectangle.X + _
                    CheckBoxRenderer.GetGlyphSize(g, _
                    CheckBoxState.UncheckedNormal).Width
                .Y = Me.ClientRectangle.Y
                .Width = Me.ClientRectangle.Width - _
                    CheckBoxRenderer.GetGlyphSize(g, _
                    CheckBoxState.UncheckedNormal).Width
                .Height = Me.ClientRectangle.Height
            End With
        End Using
        Return textRectangleValue
    End Get
End Property
// Calculate the text bounds, exluding the check box.
public Rectangle TextRectangle
{
    get
    {
        using (Graphics g = this.CreateGraphics())
        {
            textRectangleValue.X = ClientRectangle.X +
                CheckBoxRenderer.GetGlyphSize(g,
                CheckBoxState.UncheckedNormal).Width;
            textRectangleValue.Y = ClientRectangle.Y;
            textRectangleValue.Width = ClientRectangle.Width -
                CheckBoxRenderer.GetGlyphSize(g,
                CheckBoxState.UncheckedNormal).Width;
            textRectangleValue.Height = ClientRectangle.Height;
        }

        return textRectangleValue;
    }
}
      // Draw the combo box in the current state.
protected:
    virtual void OnPaint(PaintEventArgs^ e) override 
    {
        Control::OnPaint(e);

        if (!ComboBoxRenderer::IsSupported)
        {
            this->Parent->Text = "Visual Styles Disabled";
            return;
        }

        this->Parent->Text = "CustomComboBox Enabled";

        // Always draw the main text box and drop down arrow in their
        // current states
        ComboBoxRenderer::DrawTextBox(e->Graphics, topTextBoxRectangle,
            this->Text, this->Font, textBoxState);
        ComboBoxRenderer::DrawDropDownButton(e->Graphics, arrowRectangle,
            arrowState);

        // Only draw the bottom text box if the arrow has been clicked
        if (isActivated)
        {
            ComboBoxRenderer::DrawTextBox(e->Graphics,
                bottomTextBoxRectangle, bottomText, this->Font
,
                textBoxState);
        }
    }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CheckBoxRenderer.GetGlyphSize メソッド」の関連用語

CheckBoxRenderer.GetGlyphSize メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CheckBoxRenderer.GetGlyphSize メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS