ControlPaint.DrawFocusRectangle メソッド (Graphics, Rectangle, Color, Color)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Shared Sub DrawFocusRectangle ( _ graphics As Graphics, _ rectangle As Rectangle, _ foreColor As Color, _ backColor As Color _ )
Dim graphics As Graphics Dim rectangle As Rectangle Dim foreColor As Color Dim backColor As Color ControlPaint.DrawFocusRectangle(graphics, rectangle, foreColor, backColor)
public static void DrawFocusRectangle ( Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor )
public: static void DrawFocusRectangle ( Graphics^ graphics, Rectangle rectangle, Color foreColor, Color backColor )
public static void DrawFocusRectangle ( Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor )
public static function DrawFocusRectangle ( graphics : Graphics, rectangle : Rectangle, foreColor : Color, backColor : Color )


DrawFocusRectangle メソッドと Control.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); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ControlPaint.DrawFocusRectangle メソッド (Graphics, Rectangle)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim graphics As Graphics Dim rectangle As Rectangle ControlPaint.DrawFocusRectangle(graphics, rectangle)


DrawFocusRectangle メソッドと Control.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); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ControlPaint.DrawFocusRectangle メソッド
- ControlPaint.DrawFocusRectangleのページへのリンク