Aracılığıyla paylaş


ControlPaint.DrawFocusRectangle Yöntem

Tanım

Odak dikdörtgeni çizer.

Aşırı Yüklemeler

Name Description
DrawFocusRectangle(Graphics, Rectangle, Color, Color)

Belirtilen grafik yüzeyine ve belirtilen sınırlar içinde bir odak dikdörtgeni çizer.

DrawFocusRectangle(Graphics, Rectangle)

Belirtilen grafik yüzeyine ve belirtilen sınırlar içinde bir odak dikdörtgeni çizer.

DrawFocusRectangle(Graphics, Rectangle, Color, Color)

Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs

Belirtilen grafik yüzeyine ve belirtilen sınırlar içinde bir odak dikdörtgeni çizer.

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)

Parametreler

graphics
Graphics

Çizecek Graphics olan.

rectangle
Rectangle

Rectangle Tutma tutamacı karakteri boyutlarını temsil eden.

foreColor
Color

Odak Color dikdörtgenini çizmek için nesnenin ön plan rengidir.

backColor
Color

Odak Color dikdörtgenini çizmek için nesnenin arka plan rengidir.

Örnekler

Aşağıdaki kod örneği, yöntemini ve Control.Handle özelliğini kullanmayı DrawFocusRectangle gösterir. Bu örneği çalıştırmak için aşağıdaki kodu bir forma yapıştırın. Forma ve Button2 adlı Button1 iki düğme ekleyin ve tüm olayların olay işleyicilerine bağlı olduğundan emin olun.

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

Açıklamalar

Odak dikdörtgeni, Windows'un geçerli klavye odağını hangi denetimin kullandığını belirtmek için kullandığı noktalı bir dikdörtgendir.

Şunlara uygulanır

DrawFocusRectangle(Graphics, Rectangle)

Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs
Kaynak:
ControlPaint.cs

Belirtilen grafik yüzeyine ve belirtilen sınırlar içinde bir odak dikdörtgeni çizer.

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)

Parametreler

graphics
Graphics

Çizecek Graphics olan.

rectangle
Rectangle

Rectangle Tutma tutamacı karakteri boyutlarını temsil eden.

Örnekler

Aşağıdaki kod örneği, yöntemini ve Control.Handle özelliğini kullanmayı DrawFocusRectangle gösterir. Bu örneği çalıştırmak için aşağıdaki kodu bir forma yapıştırın. forma ve Button2 adlı Button1 iki düğme ekleyin ve tüm olayların olay işleyicilerine bağlı olduğundan emin olun.

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

Açıklamalar

Odak dikdörtgeni, Windows'un geçerli klavye odağını hangi denetimin kullandığını belirtmek için kullandığı noktalı bir dikdörtgendir.

Şunlara uygulanır