在做插件开发时,小记一下,用来备忘:
1.DEV8.2的XtraTabControl控件如何获得当前打开的子窗体:XtraForm frm = (XtraForm)xtraTabControl1.SelectedTabPage.Controls[0];
2.插件开发的底层标准最好是抽象类,这样扩展性好。
3. MDIForm的问题:
SonForm1 form1 = new SonForm1();
form1.TopLevel = false;
form1.Parent = this.ClientPanel;
form1.Location = new Point(sonFormXPosion[0], 0);
form1.WindowState = FormWindowState.Normal;
form1.Show();
4. 使用dockManager控件实现窗体嵌套:
XtraForm1 form1 = new XtraForm1();
form1.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
form1.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
form1.ClientSize = new System.Drawing.Size(400, 200);
form1.Location = new System.Drawing.Point(0, 0);
form1.Dock = System.Windows.Forms.DockStyle.Fill;
form1.Name = "Form1";
form1.Text = "Form1";
form1.TopLevel = false;
form1.Show();
this.dockManager1.Panels[0].Controls.Add(form1);
5.子窗体与父窗体之间的关系:
RibbonForm1 form1;//父窗体
form1 = (RibbonForm1)this.MdiParent;//子窗体中得到父窗体的实例
得到父窗体的实例之后就可以在子窗体中操作父窗体。