Control.Handle プロパティとは? わかりやすく解説

Control.Handle プロパティ

コントロールバインド先のウィンドウ ハンドル取得します

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

解説解説
使用例使用例

ControlPaint.DrawFocusRectangle および Handle プロパティ使用したコード例次に示します。この例を実行するには、次のコードフォーム貼り付けます。そして、Button1 および Button2 という名前の 2 つボタンフォーム追加しすべてのイベントを必ずそれぞれのイベント ハンドラ関連付けます。

' This method draws a focus rectangle on Button2 using the 
' handle and client rectangle of Button2.
Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click
    ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(Button2.Handle), _
    Button2.ClientRectangle)
End Sub
// This method draws a focus rectangle on Button2 using the 
// handle and client rectangle of Button2.
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{
    ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(Button2.Handle), 
        Button2.ClientRectangle);
}
// This method draws a focus rectangle on Button2 using the 
// handle and client rectangle of Button2.
void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
{
   ControlPaint::DrawFocusRectangle( Graphics::FromHwnd( Button2->Handle ), Button2->ClientRectangle
 );
}
// This method draws a focus rectangle on button2 using the 
// handle and client rectangle of button2.
private void button1_Click(Object sender, System.EventArgs
 e)
{
    ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(button2.get_Handle()), 
        button2.get_ClientRectangle());
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Control クラス
Control メンバ
System.Windows.Forms 名前空間
CreateControl
CreateHandle
Control.CreateParams プロパティ
DestroyHandle
IsHandleCreated
OnHandleCreated
RecreateHandle
RecreatingHandle
UpdateStyles


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

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

辞書ショートカット

すべての辞書の索引

「Control.Handle プロパティ」の関連用語

Control.Handle プロパティのお隣キーワード
検索ランキング

   

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



Control.Handle プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS