c# devexpress 多个窗口
1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Windows.Forms; 9 10 namespace multiplePanel 11 { 12 public partial class Form1 : DevExpress.XtraEditors.XtraForm 13 { 14 public Form1() 15 { 16 InitializeComponent(); 17 } 18 19 private void Form1_Load(object sender, EventArgs e) 20 { 21 xtraTabbedMdiManager1.MdiParent = this; //设置控件的父表单.. 22 Form2 frm = new Form2(); 23 24 frm.MdiParent = this; //设置新建窗体的父表单为当前活动窗口 25 frm.Text = "第一个子窗口"; 26 frm.Show(); 27 28 Form3 frm1 = new Form3(); 29 30 frm1.MdiParent = this; //设置新建窗体的父表单为当前活动窗口 31 frm1.Text = "第2个子窗口"; 32 frm1.Show(); 33 xtraTabbedMdiManager1.SelectedPage = xtraTabbedMdiManager1.Pages[frm]; //使得标签的选择为当前新建的窗口 34 35 this.xtraTabbedMdiManager1.ClosePageButtonShowMode = DevExpress.XtraTab.ClosePageButtonShowMode.InAllTabPagesAndTabControlHeader; //设置标签后面添加删除按钮 , 多个标签只需要设置一次.. 36 //ShowCloseButton = DevExpress.Utils.DefaultBoolean.False; //以此隐藏页面关闭按钮 37 } 38 39 private void xtraTabPage1_Paint(object sender, PaintEventArgs e) 40 { 41 42 } 43 } 44 }
devexpress中 xtratabbedmdimanager和xtratabpage区别是什么?
常用:
1.TextEditor(barEditItem)取文本
string editValue = barEditItem1.EditValue.ToString(); //错误,返回null
string editValue = ((DevExpress.XtraEditors.TextEdit)barEditItem).EditValue.ToString(); //正确,返回文本框内容
2.ComboBoxEdit(barEditItem)添加Item
string item = "comboboxItem1";
((DevExpress.XtraEditors.Repository.RepositoryItemComboBox)this.barEditItem.Edit).Items.Add(item);
3.ComboBoxEdit(barEditItem)取文本
string itemValue = this.barEditItem.EditValue.ToString();
参考:https://wenku.baidu.com/view/fe6cf7efba0d4a7302763a9e.html