internal void ShowChild(DevExpress.XtraEditors.XtraForm frm) { string[] allowDuplicatedForm = new string[] { "frmClient" }; foreach (DevExpress.XtraTabbedMdi.XtraMdiTabPage page in this.xtraTabbedMdiManager1.Pages) { XtraForm opendFrm = page.MdiChild as XtraForm; if (allowDuplicatedForm.Contains(frm.Name)) { if (opendFrm.Text == frm.Text) { xtraTabbedMdiManager1.SelectedPage = page; frm.Dispose(); return; } } else { if (opendFrm.Name == frm.Name) { xtraTabbedMdiManager1.SelectedPage = page; frm.Dispose(); return; } } } frm.MdiParent = this; frm.Show(); }
/// <summary> /// 将窗口嵌入容器中 /// </summary> /// <param name="form"></param> /// <param name="parent"></param> private void buildFormIntoParent(DevExpress.XtraEditors.XtraForm form, System.Windows.Forms.Control parent) { form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; form.TopLevel = false; form.Parent = parent; form.Dock = DockStyle.Fill; form.Show(); }
/// <summary> /// Tạo thêm tab mới /// </summary> /// <param name="tabControl">Tên TabControl để add thêm tabpage mới vào</param> /// <param name="Text">Tiêu đề tabpage mới</param> /// <param name="Name">Tên tabpage mới</param> /// <param name="form">Tên form con của tab mới</param> /// <param name="imageIndex">index của icon</param> void TabCreating(DevExpress.XtraTab.XtraTabControl tabControl, string Text, string Name, DevExpress.XtraEditors.XtraForm form, int imageIndex) { DevExpress.XtraTab.XtraTabPage tabpage = new DevExpress.XtraTab.XtraTabPage { Text = Text, Name = Name, ImageIndex = imageIndex }; tabControl.TabPages.Add(tabpage); tabControl.SelectedTabPage = tabpage; form.TopLevel = false; form.Parent = tabpage; form.Show(); }
private void addDocument(DevExpress.XtraEditors.XtraForm _xtrForm) { if (_xtrForm == null) { return; } BaseDocument document = docMain.GetDocument(_xtrForm); if (document != null) { tvMain.Controller.Activate(document); } else { _xtrForm.MdiParent = this; _xtrForm.Show(); } }
/// Tạo thêm tab mới /// <param name="tabControl">Tên TabControl để add thêm tabpage mới vào</param> /// <param name="Text">Tiêu đề tabpage mới</param> /// <param name="Name">Tên tabpage mới</param> /// <param name="form">Tên form con của tab mới</param> /// <param name="imageIndex">index của icon</param> public void TaoTab(DevExpress.XtraTab.XtraTabControl tabControl, string Text, string Name, DevExpress.XtraEditors.XtraForm form, int imageIndex) { int index = KiemTraTonTai(tabControl, Name); if (index >= 0) { tabControl.SelectedTabPage = tabControl.TabPages[index]; tabControl.SelectedTabPage.Text = Text; } else { DevExpress.XtraTab.XtraTabPage tabpage = new DevExpress.XtraTab.XtraTabPage { Text = Text, Name = Name, ImageIndex = imageIndex }; tabControl.TabPages.Add(tabpage); tabControl.SelectedTabPage = tabpage; form.TopLevel = false; form.Parent = tabpage; form.Show(); form.Dock = DockStyle.Fill; } }
private void OpenForm(DevExpress.XtraEditors.XtraForm frm, DevExpress.XtraTab.XtraTabControl XTabControl) { foreach (DevExpress.XtraTab.XtraTabPage tab in tabControl.TabPages) { if (tab.Text == frm.Text) { tabControl.SelectedTabPage = tab; return; } } DevExpress.XtraTab.XtraTabPage XTabPage = new DevExpress.XtraTab.XtraTabPage { Text = frm.Text }; XTabControl.TabPages.Add(XTabPage); XTabControl.SelectedTabPage = XTabPage; frm.WindowState = FormWindowState.Maximized; frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; frm.TopLevel = false; frm.Parent = XTabPage; frm.Show(); frm.Dock = DockStyle.Fill; }
private void GetReport(string FormsID) { string GetReportRL = string.Format(@"/api/Report/GetReport/"); var client = new ClientConnect(); var param = new Dictionary <string, string>(); var header = new Dictionary <string, string>(); param.Add("FormsID", FormsID); _Forms.UniqueDataStructure.AcceptChanges(); DataSet TheData = new DataSet(); TheData.Tables.Clear(); TheData.Tables.Add(_Forms.UniqueDataStructure); string JSOResult; JSOResult = JsonConvert.SerializeObject(TheData, Formatting.Indented); try { //this.pdfViewer1.LoadDocument(@"..\..\Report.pdf" var response = Task.Run(() => client.PostWithBodyAndParameters(GetReportRL, param, JSOResult)).Result; _PrintedForm = JsonConvert.DeserializeObject <PrintedForm>(response); string txtPDF = _PrintedForm.PDFLocation; if (File.Exists(@_PrintedForm.PDFLocation)) { if (MoveToProdind) { //Process.Start("explorer.exe", _PrintedForm.PDFLocation); PdfViewer i = new PdfViewer(); DevExpress.XtraEditors.XtraForm jj = new DevExpress.XtraEditors.XtraForm(); i.LoadDocument(@_PrintedForm.PDFLocation); i.Dock = DockStyle.Fill; i.ZoomMode = PdfZoomMode.FitToWidth; i.NavigationPanePageVisibility = PdfNavigationPanePageVisibility.None; jj.Controls.Add(i); jj.Width = 600; jj.Height = 800; jj.Show(); jj.ShowIcon = false; jj.Text = "OCR - DOCUMENT PREVIEW"; i.CreateRibbon(); // PdfPrinterSettings ps = new PdfPrinterSettings(); // i.Print(ps); } else { PdfViewer i = new PdfViewer(); DevExpress.XtraEditors.XtraForm jj = new DevExpress.XtraEditors.XtraForm(); i.LoadDocument(@_PrintedForm.PDFLocation); i.Dock = DockStyle.Fill; i.ZoomMode = PdfZoomMode.FitToWidth; i.NavigationPanePageVisibility = PdfNavigationPanePageVisibility.None; jj.Controls.Add(i); jj.Width = 600; jj.Height = 800; jj.Show(); jj.ShowIcon = false; jj.Text = "CHECKLIST EXAMPLE - CANNOT BE PRINTED"; } } } catch (Exception error) { } }