CheckBoxRenderer.GetGlyphSize メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim g As Graphics Dim state As CheckBoxState Dim returnValue As Size returnValue = CheckBoxRenderer.GetGlyphSize(g, state)
戻り値
チェック ボックスのグリフの大きさを表す 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); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からCheckBoxRenderer.GetGlyphSize メソッドを検索する場合は、下記のリンクをクリックしてください。

- CheckBoxRenderer.GetGlyphSize メソッドのページへのリンク