anyone2012 你好,
捕捉 Form 的 Resize 事件,添加排列代码,实现c1ToolBar2排到c1ToolBar1的后面:-
- private void frmSP1_Resize(object sender, EventArgs e)
- {
- this.c1CommandDock1.SuspendLayout();
- this.c1ToolBar2.SuspendLayout();
- this.c1ToolBar1.Location = new Point(3, 0);
- //this.c1ToolBar2.Location = new Point(this.c1ToolBar1.Location.X+this.c1ToolBar1.Width + 3, this.c1ToolBar1.Location.Y);
- Point pt = this.c1CommandDock1.PointToScreen(new Point(this.c1ToolBar1.Right + 3, 0));
- this.c1CommandDock1.DockOrFloatChild(this.c1ToolBar2, pt);
- this.c1ToolBar2.SetBounds(this.c1ToolBar2.Location.X, this.c1ToolBar2.Location.Y, this.c1ToolBar2.Size.Width, this.c1ToolBar2.Size.Height);
- this.c1ToolBar2.ResumeLayout(false);
- this.c1CommandDock1.ResumeLayout(false);
- }
复制代码 |