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

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

VisualStyleRenderer.GetPoint メソッド

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

現在の visual スタイル要素の、指定したポイント プロパティの値を返します

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

Public Function GetPoint ( _
    prop As PointProperty _
) As Point
Dim instance As VisualStyleRenderer
Dim prop As PointProperty
Dim returnValue As Point

returnValue = instance.GetPoint(prop)
public Point GetPoint (
    PointProperty prop
)
public:
Point GetPoint (
    PointProperty prop
)
public Point GetPoint (
    PointProperty prop
)
public function GetPoint (
    prop : PointProperty
) : Point

パラメータ

prop

現在の visual スタイル要素取得対象プロパティ値を指定する PointProperty 値の 1 つ

戻り値
現在の visual スタイル要素の、prop パラメータ指定したプロパティの値を格納している Point

例外例外
例外種類条件

InvalidEnumArgumentException

propPointProperty 値ではありません。

解説解説

visual スタイルは、スタイル定義されている要素一部プロパティを示すのに、ポイント値のセット使用します。これらのプロパティは、PointProperty の値によってカプセル化されます

使用例使用例

次のコード例では、カスタム コントロールGetPoint メソッド使用してタイトル バー右上隅を基準とした [閉じる] ボタンオフセット取得する方法示します。このコード例は VisualStyleRenderer クラス概要取り上げているコード例一部分です。

' Get the sizes and offsets for the window parts as specified 
' by the visual style.
Private Sub GetPartDetails()
    ' Do nothing further if visual styles are not enabled.
    If Not Application.RenderWithVisualStyles
 Then
        Return
    End If

    Using g As Graphics = Me.CreateGraphics()
        ' Get the size and offset of the close button.
        If SetRenderer(windowElements("windowClose"))
 Then
            closeButtonSize = _
                renderer.GetPartSize(g, ThemeSizeType.True)
            closeButtonOffset = _
                renderer.GetPoint(PointProperty.Offset)
        End If

        ' Get the height of the window caption.
        If SetRenderer(windowElements("windowCaption"))
 Then
            captionHeight = renderer.GetPartSize(g, _
                ThemeSizeType.True).Height
        End If

        ' Get the thickness of the left, bottom, and right 
        ' window frame.
        If SetRenderer(windowElements("windowLeft"))
 Then
            frameThickness = renderer.GetPartSize(g, _
                ThemeSizeType.True).Width
        End If

        ' Get the size of the resizing gripper.
        If SetRenderer(windowElements("statusGripper"))
 Then
            gripperSize = renderer.GetPartSize(g, _
                ThemeSizeType.True)
        End If
    End Using
End Sub
// Get the sizes and offsets for the window parts as specified  
// by the visual style.
private void GetPartDetails()
{
    // Do nothing further if visual styles are not enabled.
    if (!Application.RenderWithVisualStyles)
    {
        return;
    }

    using (Graphics g = this.CreateGraphics())
    {
        // Get the size and offset of the close button.
        if (SetRenderer(windowElements["windowClose"]))
        {
            closeButtonSize =
                renderer.GetPartSize(g, ThemeSizeType.True);
            closeButtonOffset =
                renderer.GetPoint(PointProperty.Offset);
        }

        // Get the height of the window caption.
        if (SetRenderer(windowElements["windowCaption"]))
        {
            captionHeight = renderer.GetPartSize(g,
                ThemeSizeType.True).Height;
        }

        // Get the thickness of the left, bottom, 
        // and right window frame.
        if (SetRenderer(windowElements["windowLeft"]))
        {
            frameThickness = renderer.GetPartSize(g,
                ThemeSizeType.True).Width;
        }

        // Get the size of the resizing gripper.
        if (SetRenderer(windowElements["statusGripper"]))
        {
            gripperSize = renderer.GetPartSize(g,
                ThemeSizeType.True);
        }
    }
}
    // Get the sizes and offsets for the window parts as specified
    // by the visual style.
private:
    void GetPartDetails()
    {
        // Do nothing further if visual styles are not enabled.
        if (!Application::RenderWithVisualStyles)
        {
            return;
        }

        Graphics^ g = this->CreateGraphics();

        // Get the size and offset of the close button.
        if (SetRenderer(windowElements["windowClose"]))
        {
            closeButtonSize =
                renderer->GetPartSize(g, ThemeSizeType::True);
            closeButtonOffset =
                renderer->GetPoint(PointProperty::Offset);
        }

        // Get the height of the window caption.
        if (SetRenderer(windowElements["windowCaption"]))
        {
            captionHeight = renderer->GetPartSize(g,
                ThemeSizeType::True).Height;
        }

        // Get the thickness of the left, bottom,
        // and right window frame.
        if (SetRenderer(windowElements["windowLeft"]))
        {
            frameThickness = renderer->GetPartSize(g,
                ThemeSizeType::True).Width;
        }

        // Get the size of the resizing gripper.
        if (SetRenderer(windowElements["statusGripper"]))
        {
            gripperSize = renderer->GetPartSize(g,
                ThemeSizeType::True);
        }

    }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VisualStyleRenderer クラス
VisualStyleRenderer メンバ
System.Windows.Forms.VisualStyles 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からVisualStyleRenderer.GetPoint メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からVisualStyleRenderer.GetPoint メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からVisualStyleRenderer.GetPoint メソッド を検索

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

辞書ショートカット

すべての辞書の索引

「VisualStyleRenderer.GetPoint メソッド」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS