Nyelv

ControlPaint.DrawFocusRectangle Metódus

Definíció

Fókusz téglalap rajzolása.

Túlterhelések

Név Description
DrawFocusRectangle(Graphics, Rectangle, Color, Color)

Fókusz téglalap rajzolása a megadott grafikus felületen és a megadott korlátokon belül.

DrawFocusRectangle(Graphics, Rectangle)

Fókusz téglalap rajzolása a megadott grafikus felületen és a megadott korlátokon belül.

DrawFocusRectangle(Graphics, Rectangle, Color, Color)

Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs

Fókusz téglalap rajzolása a megadott grafikus felületen és a megadott korlátokon belül.

public:
 static void DrawFocusRectangle(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Drawing::Color foreColor, System::Drawing::Color backColor);
public static void DrawFocusRectangle(System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Drawing.Color foreColor, System.Drawing.Color backColor);
static member DrawFocusRectangle : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Color * System.Drawing.Color -> unit
Public Shared Sub DrawFocusRectangle (graphics As Graphics, rectangle As Rectangle, foreColor As Color, backColor As Color)

Paraméterek

graphics
Graphics

A Graphics rajzolás.

rectangle
Rectangle

A Rectangle fogópont glyph dimenzióit jelképező.

foreColor
Color

Az Color objektum előtérszíne a fókusz téglalapjának rajzolásához.

backColor
Color

Az Color objektum háttérszíne a fókusz téglalapjának rajzolásához.

Példák

Az alábbi példakód a metódus és a DrawFocusRectangleControl.Handle tulajdonság használatát mutatja be. A példa futtatásához illessze be az alábbi kódot egy űrlapba. Adjon hozzá két gombot és Button1 gomb2-t az űrlaphoz, és győződjön meg arról, hogy minden esemény csatlakoztatva van az eseménykezelőkhöz.

// 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(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 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

Megjegyzések

A fókusz téglalap egy pontozott téglalap, amelyet Windows arra használ, hogy jelezze, melyik vezérlőelemen van az aktuális billentyűzetfókusz.

A következőre érvényes:

DrawFocusRectangle(Graphics, Rectangle)

Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs
Forrás:
ControlPaint.cs

Fókusz téglalap rajzolása a megadott grafikus felületen és a megadott korlátokon belül.

public:
 static void DrawFocusRectangle(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle);
public static void DrawFocusRectangle(System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle);
static member DrawFocusRectangle : System.Drawing.Graphics * System.Drawing.Rectangle -> unit
Public Shared Sub DrawFocusRectangle (graphics As Graphics, rectangle As Rectangle)

Paraméterek

graphics
Graphics

A Graphics rajzolás.

rectangle
Rectangle

A Rectangle fogópont glyph dimenzióit jelképező.

Példák

Az alábbi példakód a metódus és a DrawFocusRectangleControl.Handle tulajdonság használatát mutatja be. A példa futtatásához illessze be az alábbi kódot egy űrlapba. Adjon hozzá két gombot az Button1 űrlaphoz, és Button2 győződjön meg arról, hogy minden esemény csatlakoztatva van az eseménykezelőkhöz.

// 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(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 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

Megjegyzések

A fókusz téglalap egy pontozott téglalap, amelyet Windows arra használ, hogy jelezze, melyik vezérlőelemen van az aktuális billentyűzetfókusz.

A következőre érvényes: