BehaviorService.ControlToAdornerWindow(Control) Yöntem

Tanım

Donatıcı penceresi koordinatlarına çevrilmiş konumu Control döndürür.

C#
public System.Drawing.Point ControlToAdornerWindow (System.Windows.Forms.Control c);

Parametreler

c
Control

Çevrilecek Control .

Döndürülenler

Point Donatıcı penceresindeki koordinatların konumunu c gösteren değer.

Örnekler

Aşağıdaki kod örneği, sınıfı için BehaviorService sağlanan daha büyük bir örneğin bir parçasıdır.

C#
public override Rectangle Bounds
{
    get
    {
        // Create a glyph that is 10x10 and sitting
        // in the middle of the control.  Glyph coordinates
        // are in adorner window coordinates, so we must map
        // using the behavior service.
        Point edge = behaviorSvc.ControlToAdornerWindow(control);
        Size size = control.Size;
        Point center = new Point(edge.X + (size.Width / 2), 
            edge.Y + (size.Height / 2));

        Rectangle bounds = new Rectangle(
            center.X - 5,
            center.Y - 5,
            10,
            10);

        return bounds;
    }
}

Şunlara uygulanır

Ürün Sürümler
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Ayrıca bkz.