Glyph::Bounds Property
.NET Framework (current version)
Gets the bounds of the Glyph.
Assembly: System.Design (in System.Design.dll)
The following example demonstrates how to override the Bounds to create a glyph with the specific dimensions and position. This code example is part of a larger example provided for the BehaviorService class.
public: virtual property Rectangle Bounds { Rectangle get() override { // 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 = behavior->ControlToAdornerWindow(control); Size size = control->Size; Point center = Point(edge.X + (size.Width / 2), edge.Y + (size.Height / 2)); Rectangle bounds = Rectangle(center.X - 5, center.Y - 5, 10, 10); return bounds; } }
.NET Framework
Available since 2.0
Available since 2.0
Show: