private static KryptonPage OpenForm(NodeInfo ninfo) { if (ninfo.NodeTag == null || ninfo.NodeTag.Equals(string.Empty) || ninfo.NodeTag.Equals("-")) { MessageBox.Show(string.Format("菜单{0}尚未配置!", ninfo.NodeText), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return(null); } UserControl uc = new UserControl(); KryptonPage pageTmp = new KryptonPage(); uc = System.Activator.CreateInstance(Type.GetType(ninfo.NodeTag)) as UserControl; pageTmp.SuspendLayout(); pageTmp.ClearFlags(KryptonPageFlags.DockingAllowAutoHidden | KryptonPageFlags.DockingAllowDocked); pageTmp.TextTitle = ninfo.NodeText; pageTmp.Text = "分组 " + ninfo.NodeText; pageTmp.TextDescription = ninfo.NodeText; pageTmp.UniqueName = ninfo.NodeName; if (!ninfo.NodeName.Equals("参数设置")) { ((UC_GeneFile)uc).LoadConfigFile(ninfo.NodeName); } else { ((UC_DataSetting)uc).LoadConfigFile(ninfo.NodeName); } pageTmp.Controls.Add(uc); uc.Dock = DockStyle.Fill; pageTmp.ResumeLayout(false); pageTmp.PerformLayout(); _pageDic.Add(pageTmp.UniqueName, pageTmp); return(pageTmp); }
private KryptonPage NewDocument() { KryptonPage page = NewPage("Document ", 0, new ContentDocument()); // Document pages cannot be docked or auto hidden page.ClearFlags(KryptonPageFlags.DockingAllowAutoHidden | KryptonPageFlags.DockingAllowDocked); return(page); }
private KryptonPage NewDocument() { KryptonPage page = NewPage("Document ", 0, new ContentDocument()); // Do not allow the document pages to be closed or made auto hidden/docked page.ClearFlags(KryptonPageFlags.DockingAllowAutoHidden | KryptonPageFlags.DockingAllowDocked | KryptonPageFlags.DockingAllowClose); return(page); }
private void cbDocked_CheckedChanged(object sender, EventArgs e) { if (cbDocked.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowDocked); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowDocked); } }
private KryptonPage NewDocument(TreeNodeMouseClickEventArgs e) { KryptonPage page = null; if (e.Node.Parent != null) { page = NewPage(e.Node.Parent.Text + "_" + e.Node.Text, 1, new SettingViewer(e.Node.Text)); } else { page = NewPage(e.Node.Text, 1, new SettingViewer(e.Node.Text)); } // Document pages cannot be docked or auto hidden page.ClearFlags(KryptonPageFlags.DockingAllowAutoHidden | KryptonPageFlags.DockingAllowDocked); return(page); }
private KryptonPage NewPage(string name, int image, Control content) { // Create new page with title and image KryptonPage p = new KryptonPage(); p.Text = name; p.TextTitle = name; p.TextDescription = name; p.ClearFlags(KryptonPageFlags.DockingAllowClose | KryptonPageFlags.DockingAllowFloating | KryptonPageFlags.DockingAllowWorkspace); //p.ImageSmall = imageListIcon.Images[image]; // Add the control for display inside the page content.Dock = DockStyle.Fill; p.Controls.Add(content); _count++; return(p); }
private KryptonPage NewMenu(string s) { // Create new page with title and image KryptonPage p = new KryptonPage(); p.Text = s + "信 息 "; p.TextTitle = p.Text; p.TextDescription = p.Text; p.UniqueName = p.Text; // Add the control for display inside the page ucMenu.Dock = DockStyle.Fill; ucMenu.Text = "Page Content"; p.Controls.Add(ucMenu); p.ClearFlags(KryptonPageFlags.DockingAllowDropDown | KryptonPageFlags.DockingAllowClose | KryptonPageFlags.DockingAllowFloating | KryptonPageFlags.DockingAllowWorkspace | KryptonPageFlags.AllowPageDrag); return(p); }
private KryptonPage NewPage(string name, Control content, Image icon = null) { // Create new page with title and image var page = new KryptonPage { Text = name, TextTitle = name, TextDescription = name }; if (icon != null) { page.ImageSmall = icon; } page.ClearFlags(KryptonPageFlags.DockingAllowClose); // Add the control for display inside the page content.Dock = DockStyle.Fill; page.Controls.Add(content); return(page); }
internal void InitialDockingMenu() { ucMenu = new UCMenu(); ucMenu.ChangeSelect += new ChangeSelectHandler(MainFormNodeChaned); KryptonDockingWorkspace w = kryptonDockingManager.ManageWorkspace(kDWorkspaceContent); kryptonDockingManager.ManageControl(panel1, w); kryptonDockingManager.ManageFloating(this); // Add docking pages KryptonPage kp = NewMenu("分 组 "); kp.Width = 50; kp.UniqueName = "left"; KryptonPage[] kpArr = new KryptonPage[] { kp }; //KryptonDockingControl kdc = new KryptonDockingControl("Menu",,w); kryptonDockingManager.AddDockspace("Control", DockingEdge.Left, kpArr); kp.ClearFlags(KryptonPageFlags.DockingAllowDropDown | KryptonPageFlags.DockingAllowClose | KryptonPageFlags.DockingAllowFloating | KryptonPageFlags.DockingAllowWorkspace | KryptonPageFlags.AllowPageDrag); }
private void buttonOK_Click(object sender, EventArgs e) { if (checkBoxPageInOverflowBarForOutlookMode.Checked) { _page.SetFlags(KryptonPageFlags.PageInOverflowBarForOutlookMode); } else { _page.ClearFlags(KryptonPageFlags.PageInOverflowBarForOutlookMode); } if (checkBoxAllowPageDrag.Checked) { _page.SetFlags(KryptonPageFlags.AllowPageDrag); } else { _page.ClearFlags(KryptonPageFlags.AllowPageDrag); } if (checkBoxAllowPageReorder.Checked) { _page.SetFlags(KryptonPageFlags.AllowPageReorder); } else { _page.ClearFlags(KryptonPageFlags.AllowPageReorder); } if (checkBoxAllowConfigSave.Checked) { _page.SetFlags(KryptonPageFlags.AllowConfigSave); } else { _page.ClearFlags(KryptonPageFlags.AllowConfigSave); } if (checkBoxDockingAllowClose.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowClose); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowClose); } if (checkBoxDockingAllowDropDown.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowDropDown); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowDropDown); } if (checkBoxDockingAllowAutoHidden.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowAutoHidden); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowAutoHidden); } if (checkBoxDockingAllowDocked.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowDocked); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowDocked); } if (checkBoxDockingAllowFloating.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowFloating); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowFloating); } if (checkBoxDockingAllowWorkspace.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowWorkspace); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowWorkspace); } if (checkBoxDockingAllowNavigator.Checked) { _page.SetFlags(KryptonPageFlags.DockingAllowNavigator); } else { _page.ClearFlags(KryptonPageFlags.DockingAllowNavigator); } }