BehaviorService.ControlToAdornerWindow メソッド
アセンブリ: System.Design (system.design.dll 内)

Dim instance As BehaviorService Dim c As Control Dim returnValue As Point returnValue = instance.ControlToAdornerWindow(c)
戻り値
装飾ウィンドウ座標における c の位置を示す Point の値。

次のコード例は、BehaviorService クラスのトピックで取り上げているコード例の一部分です。
Public Overrides ReadOnly Property Bounds() As Rectangle 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. Dim edge As Point = behaviorSvc.ControlToAdornerWindow(control) Dim size As Size = control.Size Dim center As New Point(edge.X + size.Width / 2, edge.Y + _ size.Height / 2) Dim bounds1 As New Rectangle(center.X - 5, center.Y - 5, 10, 10) Return bounds1 End Get End Property
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; } }


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- BehaviorService.ControlToAdornerWindow メソッドのページへのリンク