Northwoods.Go Assembly > Northwoods.Go Namespace > GoSubGraph Class : LayoutHandle Method |
'Declaration Public Overridable Sub LayoutHandle()
public virtual void LayoutHandle()
To place the handle in the margin at the top-left corner, rather than the default position inside the margins: public override void LayoutHandle() { if (!this.IsExpanded) return; GoSubGraphHandle h = this.Handle; if (h != null) { RectangleF b = ComputeBorder(); // top-left, in the margins h.Position = new PointF(b.X, b.Y); } }
To place the handle at the top-right corner, you could implement these overrides: public override void LayoutHandle() { if (!this.IsExpanded) return; GoSubGraphHandle h = this.Handle; if (h != null) { RectangleF b = ComputeInsideMargins(null); // top-right, inside margin h.SetSpotLocation(TopRight, GetRectangleSpotLocation(b, TopRight)); } } // Make sure the collapsed subgraph body (including any CollapsedObject) // is positioned to the left of the handle. protected override RectangleF ComputeCollapsedRectangle(SizeF s) { PointF hpos = ComputeReferencePoint(); return new RectangleF(hpos.X + this.Handle.Width - s.Width, hpos.Y, s.Width, s.Height); }
For more examples, see the classes in the SubGraphApp sample.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2