如下图所示。
class LayoutPreviewBarWindow : DockableToolbar, BMG.IGuiDockable { #region 单例 static private LayoutPreviewBarWindow _layoutPreBarWindow; #endregion private LayoutPreviewBar _bar; public LayoutPreviewBarWindow() { _bar = new LayoutPreviewBar(); _bar.VerticalContentAlignment = VerticalAlignment.Center; this.Content = _bar; this.Title = "LayoutPreview ToolBar"; this.AttachingToHost += new BMG.AttachingToHostEventHandler(Window_AttacthToHost); this.DetachingFromHost += new EventHandler(Window_DetachingFromHost); this.Attach(SubgradeNET.Instance(), "SubgradeNET"); //Setup AutoOpen after calling Attach() this.AutoOpen = true; this.AutoOpenKeyin = "mdl silentload subgradeNETUI,,DEFAULTDOMAIN;SubgradeNET CrossAidedDesign LayoutPreviewBETA"; }
这个我记得是窗体类实例作为一个控件添加到Mstn管理的窗体中了,在父窗体Resize的时候,子窗体也就是您这里的LayoutPreviewBarWindow的位置(Location属性)没有边导致子窗体跑到可现实范围外造成的,您试试监听一下Resize事件(重写的IGuiDockable的WindowMoving函数),在事件函数中去设置一下子窗体的Location属性。
您好,LayoutPreviewBarWindow没有Location属性,继承自DockableToolbar,没看到Location的属性;
试试ElementHost.Location。
好的,Location设置为何值呢?哪里可以获取到正确的子窗体位置?
窗体正常显示时,读取一下这个值看是多少,应该是(0,0)的。