public static void OpenInputForm(XtraUserControl uc, string vnTitle, string enTitle, Size size) { string languageID = new Configuration().Language; frmOpen frm = new frmOpen(); frm.Text = (languageID.Equals("vi-VN")) ? vnTitle : enTitle; frm.Size = size; frm.MaximumSize = size; frm.MinimumSize = size; frm.Controls.Clear(); uc.Dock = DockStyle.Fill; frm.Controls.Add(uc); uc.Show(); frm.ShowDialog(); }
public static void OpenForm(frmMain index, XtraUserControl uc, string vnTitle, string enTitle, XtraTabbedMdiManager tabMain) { string languageID = new Configuration().Language; bool found = false; foreach (XtraForm frm in index.MdiChildren) { if (frm.Text.Equals((languageID.Equals("vi-VN")) ? vnTitle : enTitle)) { found = true; break; } } if (found) { foreach (XtraMdiTabPage tab in tabMain.Pages) { if (tab.Text.Equals((languageID.Equals("vi-VN")) ? vnTitle : enTitle)) { tabMain.SelectedPage = tab; break; } } } else { XtraForm frm = new XtraForm(); frm.Text = (languageID.Equals("vi-VN")) ? vnTitle : enTitle; frm.MdiParent = index; uc.Dock = DockStyle.Fill; frm.Controls.Clear(); frm.Controls.Add(uc); frm.Show(); } }