public void AddTab(UserControl ctrl, string name) { try { PanelDockContainer pdc = new PanelDockContainer(); pdc.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; pdc.Location = new System.Drawing.Point(3, 28); pdc.Name = "CONTROLID" + bar5.Items.Count.ToString(); pdc.Size = new System.Drawing.Size(553, 265); pdc.Style.Alignment = System.Drawing.StringAlignment.Center; pdc.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; pdc.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; pdc.Style.GradientAngle = 90; pdc.TabIndex = 2; ctrl.Dock = DockStyle.Fill; pdc.Controls.Add(ctrl); DockContainerItem dci = new DockContainerItem(); dci.Control = pdc; // ho.AddProperty(props, dci, pdc, proj); dci.Name = "TAB" + bar5.Items.Count.ToString(); pdc.Tag = dci; dci.Text = name; bar5.Controls.Add(pdc); bar5.Items.Add(dci); bar5.SelectedDockContainerItem = dci; dci.Tag = ctrl; } catch { } }
public void Display(DataRow patientRow) { if (patientRow == null) { return; } string patientGUID = patientRow["PatientGUID"].ToString(); DataRow[] rows = null; bool isAddNew = true; //Update patient row to all doctab foreach (DockContainerItem item in docBar.Items) { if (item.Control.Tag == null) { continue; } string id = item.Control.Tag.ToString(); rows = Global.dtOpenPatient.Select(string.Format("PatientGUID='{0}'", id)); if (id != patientGUID) { if (rows != null && rows.Length > 0) { PanelDockContainer p = item.Control as PanelDockContainer; uPatient ctrl = p.Controls[0] as uPatient; ctrl.PatientRow = rows[0]; } else { item.Visible = false; } } else { item.Text = string.Format("{0} - {1}", rows[0]["FileNum"], rows[0]["FullName"]); PanelDockContainer p = item.Control as PanelDockContainer; uPatient ctrl = p.Controls[0] as uPatient; p.Tag = patientGUID; ctrl.PatientRow = rows[0]; ctrl.DisplayInfo(); item.Visible = true; item.Selected = true; isAddNew = false; } } if (isAddNew) { _patientRow = patientRow; string fileNum = _patientRow["FileNum"] as string; string fullName = _patientRow["Fullname"] as string; AddDockContainerItem(fileNum, fullName, patientGUID); } docBar.Visible = true; }
/// <summary> /// 对树进行操作 /// </summary> public void Operate(PanelDockContainer pdc, TreeViewEventHandler afterselect, TreeViewCancelEventHandler beforeselect, NodeLabelEditEventHandler beforelabeledit, NodeLabelEditEventHandler afterlabeledit) { //tree.ContextMenuStrip = this.contextMenuStrip1; PDC = pdc; this.afterSelect = afterselect; this.beforeSelect = beforeselect; this.beforeLabelEdit = beforelabeledit; this.afterLabelEdit = afterlabeledit; }
//只读模式 public Class1(string tblname, string catfield, PanelDockContainer pdc, SqlConnection conn) { m_OldForm = null; m_TblName = tblname; m_CatField = catfield; m_PDC = pdc; m_Conn = conn; // helper = new Helper(); Helper.Conn = m_Conn; Helper.adp_hash = new Hashtable(); m_isReadOnly = true; }
private void AddDockContainerItem(string fileNum, string fullName, string patientGUID) { if (_isFirst) { dockContainerItem1.Name = fileNum; dockContainerItem1.Text = string.Format("{0} - {1}", fileNum, fullName); dockContainerItem1.Visible = true; if (panelDockContainer1.Controls.Count <= 0) { uPatient ctrl = new uPatient(); ctrl.PatientRow = _patientRow; panelDockContainer1.Tag = patientGUID; panelDockContainer1.Controls.Add(ctrl); ctrl.Dock = DockStyle.Fill; ctrl.DisplayInfo(); } else { panelDockContainer1.Tag = patientGUID; uPatient ctrl = panelDockContainer1.Controls[0] as uPatient; ctrl.PatientRow = _patientRow; ctrl.DisplayInfo(); } _isFirst = false; } else { DockContainerItem item = new DockContainerItem(fileNum, string.Format("{0} - {1}", fileNum, fullName)); PanelDockContainer p = new PanelDockContainer(); p.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Windows7; p.Style.Alignment = System.Drawing.StringAlignment.Center; p.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; p.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; p.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; p.Style.GradientAngle = 90; p.Tag = patientGUID; uPatient ctrl = new uPatient(); ctrl.PatientRow = _patientRow; p.Controls.Add(ctrl); ctrl.Dock = DockStyle.Fill; ctrl.DisplayInfo(); docBar.Controls.Add(p); item.Control = p; docBar.Items.Add(item); item.Selected = true; } }
public Class1(PanelDockContainer pdc, TreeViewEventHandler afterselect, TreeViewCancelEventHandler beforeselect, NodeLabelEditEventHandler beforelabeledit, NodeLabelEditEventHandler afterlabeledit, SqlConnection conn) { m_OldForm = null; m_PDC = pdc; this.afterSelect = afterselect; this.beforeSelect = beforeselect; this.beforeLabelEdit = beforelabeledit; this.afterLabelEdit = afterlabeledit; m_Conn = conn; // helper = new Helper(); Helper.Conn = m_Conn; Helper.adp_hash = new Hashtable(); }
public Class1(string tblname, string catfield, PanelDockContainer pdc, TreeViewEventHandler afterselect, TreeViewCancelEventHandler beforeselect, NodeLabelEditEventHandler beforelabeledit, NodeLabelEditEventHandler afterlabeledit, SqlConnection conn) { OldForm = null; TblName = tblname; CatField = catfield; PDC = pdc; this.afterSelect = afterselect; this.beforeSelect = beforeselect; this.beforeLabelEdit = beforelabeledit; this.afterLabelEdit = afterlabeledit; Conn = conn; helper = new Helper(); Helper.Conn = Conn; Helper.adp_hash = new Hashtable(); }
public DevComponents.DotNetBar.PanelDockContainer CreatePanelDockContainer(string panelName, DevComponents.DotNetBar.Bar bar) { DevComponents.DotNetBar.PanelDockContainer panelDockContainer = new PanelDockContainer(); panelDockContainer.Name = panelName; panelDockContainer.Style.Alignment = System.Drawing.StringAlignment.Center; panelDockContainer.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; panelDockContainer.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; panelDockContainer.Style.BackgroundImagePosition = DevComponents.DotNetBar.eBackgroundImagePosition.Tile; panelDockContainer.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; panelDockContainer.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; panelDockContainer.Style.GradientAngle = 90; panelDockContainer.Dock = DockStyle.Fill; bar.Controls.Add(panelDockContainer); return(panelDockContainer); }
private void CreateForms(string name, string strnamespace, string FilePath) { try { bool isBar = false; for (int i = 0; i < bar3.Items.Count; i++) { if (!bar3.Visible) { bar3.Visible = true; } string str = bar3.Items[i].Text; if (str == name) { bar3.Items[i].Visible = true; bar3.SelectedDockTab = i; bar3.Refresh(); isBar = true; break; } } if (!isBar) { Assembly outerAsm = Assembly.LoadFrom(FilePath); Type outerForm = outerAsm.GetType(strnamespace, false); Form fm = Activator.CreateInstance(outerForm) as Form; fm.Text = name; fm.TopLevel = false; fm.Dock = DockStyle.Fill; DockContainerItem item = null; PanelDockContainer panel = new PanelDockContainer(); item = new DockContainerItem(); item.CanClose = eDockContainerClose.Yes; item.Control = panel; item.Text = name; panel.Dock = DockStyle.Fill; panel.Controls.Add(fm); bar3.Items.Add(item); fm.Show(); bar3.SelectedDockContainerItem = item; } } catch (Exception e) { MessageBox.Show("创建窗体失败!" + e.ToString()); } }
public void AddAsTab(string name, Bar bar) { var i = new DockContainerItem(name); i.Text = name; var panel = new PanelDockContainer(); panel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; panel.DisabledBackColor = System.Drawing.Color.Empty; panel.Location = new System.Drawing.Point(3, 28); panel.Name = name + "Container"; panel.Size = new System.Drawing.Size(688, 234); panel.Style.Alignment = System.Drawing.StringAlignment.Center; panel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; panel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; panel.Style.GradientAngle = 90; panel.Dock = DockStyle.Fill; i.Control = panel; bar.Controls.Add(panel); bar.Items.Add(i); }
//打开首页 public void ShowForm(Form form, string menuName, string menuId) { int index = this.barMainContainer.Items.IndexOf(menuId); if (index < 0) { if (form != null) { //List<DockContainerItem> listitem = new List<DockContainerItem>(); //CloseTab delegateCloseTable = delegate() //{ // foreach (DockContainerItem item in listitem) // barMainContainer.CloseDockTab(item); //}; barMainContainer.BeginInit(); int displayWay = CustomConfigManager.GetDisplayWay();//显示方式 0 标准 1全屏 if (displayWay == 1) { form.Dock = DockStyle.Fill; } form.Size = new Size(1000, 600); form.FormBorderStyle = FormBorderStyle.None; form.TopLevel = false; if (this.barMainContainer.Width > form.Width) { form.Location = new Point((barMainContainer.Width - form.Width) / 2, 0); } else { form.Location = new Point(0, 0); } form.Show(); PanelDockContainer panelDockMain = new PanelDockContainer(); panelDockMain.Dock = DockStyle.Fill; panelDockMain.Controls.Add(form); panelDockMain.Location = new System.Drawing.Point(3, 28); panelDockMain.Style.Alignment = System.Drawing.StringAlignment.Center; panelDockMain.Style.GradientAngle = 90; panelDockMain.BackColor = Color.FromArgb(227, 239, 255); panelDockMain.AutoScroll = true; DockContainerItem item = new DockContainerItem(form.Text); item.Text = menuName; item.Name = menuId; item.Control = panelDockMain; item.Visible = true; item.Tag = form;//绑定界面对象 //item.Image = GetButtonImage(btnImage); //listitem.Add(item); item.VisibleChanged += new EventHandler(item_VisibleChanged); //this.barMainContainer.Controls.Add(panelDockMain); this.barMainContainer.Items.Add(item); this.barMainContainer.SelectedDockContainerItem = item; barMainContainer.EndInit(); this.barMainContainer.Show(); if (form is BaseFormBusiness) { (form as BaseFormBusiness).ExecOpenWindowBefore(form, null); } } } else { this.barMainContainer.SelectedDockContainerItem = (DockContainerItem)this.barMainContainer.Items[index]; string formname = ((DockContainerItem)this.barMainContainer.Items[index]).Tag.GetType().Name; if (formname == "FrmWebBrowser") { IfrmWebBrowserView webbrowser = (IfrmWebBrowserView)((DockContainerItem)this.barMainContainer.Items[index]).Tag; webbrowser.NavigateUrl();//重新加载网址 } } }
public void createEditorTab(string Location) { ScintillaNet.Scintilla scintilla = new ScintillaNet.Scintilla(); scintilla.Caret.BlinkRate = 500; if (Location.ToLower().EndsWith(".java")) { scintilla.ConfigurationManager.CustomLocation = "C:\\Program Files\\Bukkit Plugin Writer\\code highlighting.xml"; scintilla.ConfigurationManager.Language = "java"; } else if (Location.ToLower().EndsWith(".yml") || Location.ToLower().EndsWith(".yaml")) { scintilla.ConfigurationManager.Language = "yaml"; } scintilla.Dock = System.Windows.Forms.DockStyle.Fill; scintilla.Folding.IsEnabled = false; scintilla.Indentation.TabWidth = 4; scintilla.Indentation.UseTabs = false; scintilla.Location = new System.Drawing.Point(0, 0); scintilla.Margins.Margin0.Width = 20; scintilla.Margins.Margin2.IsClickable = false; scintilla.Margins.Margin2.IsFoldMargin = false; scintilla.Name = "scintilla1"; scintilla.Printing.PageSettings.Color = false; scintilla.Size = new System.Drawing.Size(377, 147); scintilla.Styles.Bits = 5; scintilla.Styles.BraceBad.FontName = "Verdana"; scintilla.Styles.BraceLight.FontName = "Verdana"; scintilla.Styles.ControlChar.FontName = "Verdana"; scintilla.Styles.Default.FontName = "Verdana"; scintilla.Styles.IndentGuide.FontName = "Verdana"; scintilla.Styles.LastPredefined.FontName = "Verdana"; scintilla.Styles.LineNumber.FontName = "Verdana"; scintilla.Styles.Max.FontName = "Verdana"; scintilla.TabIndex = 0; scintilla.KeyPress += new KeyPressEventHandler(scintilla_KeyPress); DockContainerItem tab = new DockContainerItem(); PanelDockContainer container = new PanelDockContainer(); tab.Control = container; bar4.Items.Add(tab); container.Controls.Add(scintilla); tab.Text = "New File"; if (Location != "") { if (System.IO.File.Exists(Location)) { System.IO.StreamReader reader = new System.IO.StreamReader(Location); scintilla.Text = reader.ReadToEnd(); scintilla.Tag = Location; reader.Close(); tab.Text = Location.Split('\\')[Location.Split('\\').Count() - 1]; int i = 0; foreach (DockContainerItem tabb in bar4.Items) { if (tabb == tab) { break; } else { i++; } } bar4.SelectedDockTab = i; } } }
/// <summary> /// Initializes a new instance of the <see cref="ToolWindowBase"/> class with default settings. /// </summary> /// <param name="designer">The report designer.</param> /// <remarks> /// You don't need to call this constructor. The designer will do this automatically. /// </remarks> public ToolWindowBase(Designer designer) : base() { FDesigner = designer; FShortcut = eShortcut.None; Control = new PanelDockContainer(); }
private void InitializeComponent() { this.components = new Container(); this.mdiClient1 = new MdiClient(); this.timer_send = new System.Windows.Forms.Timer(this.components); this.NetBarManager = new DotNetBarManager(this.components); this.dockSite4 = new DockSite(); this.bar1 = new Bar(); this.panelDockContainer1 = new PanelDockContainer(); this.syslogbox = new TextBox(); this.panelDockContainer2 = new PanelDockContainer(); this.dockContainerItem1 = new DockContainerItem(); this.dockContainerItem2 = new DockContainerItem(); this.dockSite1 = new DockSite(); this.dockSite2 = new DockSite(); this.dockSite8 = new DockSite(); this.dockSite5 = new DockSite(); this.dockSite6 = new DockSite(); this.dockSite7 = new DockSite(); this.dockSite3 = new DockSite(); this.tabStrip1 = new TabStrip(); this.dockSite4.SuspendLayout(); this.bar1.BeginInit(); this.bar1.SuspendLayout(); this.panelDockContainer1.SuspendLayout(); base.SuspendLayout(); this.mdiClient1.BackColor = Color.FromArgb(0xc2, 0xd9, 0xf7); this.mdiClient1.Dock = DockStyle.Fill; this.mdiClient1.Location = new Point(0, 0x1a); this.mdiClient1.Name = "mdiClient1"; this.mdiClient1.Size = new Size(0x265, 0x109); this.mdiClient1.TabIndex = 0x19; this.timer_send.Enabled = true; this.timer_send.Interval = 0x1388; this.timer_send.Tick += new EventHandler(this.timer_send_Tick); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.F1); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.CtrlC); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.CtrlA); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.CtrlV); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.CtrlX); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.CtrlZ); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.CtrlY); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.Del); this.NetBarManager.AutoDispatchShortcuts.Add(eShortcut.Ins); this.NetBarManager.BottomDockSite = this.dockSite4; this.NetBarManager.DefinitionName = ""; this.NetBarManager.EnableFullSizeDock = false; this.NetBarManager.LeftDockSite = this.dockSite1; this.NetBarManager.ParentForm = this; this.NetBarManager.RightDockSite = this.dockSite2; this.NetBarManager.Style = eDotNetBarStyle.Office2007; this.NetBarManager.ToolbarBottomDockSite = this.dockSite8; this.NetBarManager.ToolbarLeftDockSite = this.dockSite5; this.NetBarManager.ToolbarRightDockSite = this.dockSite6; this.NetBarManager.ToolbarTopDockSite = this.dockSite7; this.NetBarManager.TopDockSite = this.dockSite3; this.dockSite4.Controls.Add(this.bar1); this.dockSite4.Dock = DockStyle.Bottom; this.dockSite4.DocumentDockContainer = new DocumentDockContainer(new DocumentBaseContainer[] { new DocumentBarContainer(this.bar1, 0x265, 0x8f) }, eOrientation.Vertical); this.dockSite4.Location = new Point(0, 0x123); this.dockSite4.Name = "dockSite4"; this.dockSite4.Size = new Size(0x265, 0x92); this.dockSite4.TabIndex = 0x1d; this.dockSite4.TabStop = false; this.bar1.AccessibleDescription = "DotNetBar Bar (bar1)"; this.bar1.AccessibleName = "DotNetBar Bar"; this.bar1.AutoSyncBarCaption = true; this.bar1.CloseSingleTab = true; this.bar1.Controls.Add(this.panelDockContainer1); this.bar1.Controls.Add(this.panelDockContainer2); this.bar1.GrabHandleStyle = eGrabHandleStyle.Caption; this.bar1.Items.AddRange(new BaseItem[] { this.dockContainerItem1, this.dockContainerItem2 }); this.bar1.LayoutType = eLayoutType.DockContainer; this.bar1.Location = new Point(0, 3); this.bar1.Name = "bar1"; this.bar1.SelectedDockTab = 0; this.bar1.Size = new Size(0x265, 0x8f); this.bar1.Stretch = true; this.bar1.Style = eDotNetBarStyle.Office2007; this.bar1.TabIndex = 0; this.bar1.TabStop = false; this.bar1.Text = "日志"; this.panelDockContainer1.ColorSchemeStyle = eDotNetBarStyle.Office2007; this.panelDockContainer1.Controls.Add(this.syslogbox); this.panelDockContainer1.Location = new Point(3, 0x17); this.panelDockContainer1.Name = "panelDockContainer1"; this.panelDockContainer1.Size = new Size(0x25f, 0x5c); this.panelDockContainer1.Style.Alignment = StringAlignment.Center; this.panelDockContainer1.Style.BackColor1.ColorSchemePart = eColorSchemePart.BarBackground; this.panelDockContainer1.Style.BackColor2.ColorSchemePart = eColorSchemePart.BarBackground2; this.panelDockContainer1.Style.BorderColor.ColorSchemePart = eColorSchemePart.BarDockedBorder; this.panelDockContainer1.Style.ForeColor.ColorSchemePart = eColorSchemePart.ItemText; this.panelDockContainer1.Style.GradientAngle = 90; this.panelDockContainer1.TabIndex = 0; this.syslogbox.Dock = DockStyle.Fill; this.syslogbox.Location = new Point(0, 0); this.syslogbox.Multiline = true; this.syslogbox.Name = "syslogbox"; this.syslogbox.ScrollBars = ScrollBars.Vertical; this.syslogbox.Size = new Size(0x25f, 0x5c); this.syslogbox.TabIndex = 0; this.panelDockContainer2.ColorSchemeStyle = eDotNetBarStyle.Office2007; this.panelDockContainer2.Location = new Point(3, 0x17); this.panelDockContainer2.Name = "panelDockContainer2"; this.panelDockContainer2.Size = new Size(0x25f, 0x5c); this.panelDockContainer2.Style.Alignment = StringAlignment.Center; this.panelDockContainer2.Style.BackColor1.ColorSchemePart = eColorSchemePart.BarBackground; this.panelDockContainer2.Style.BackColor2.ColorSchemePart = eColorSchemePart.BarBackground2; this.panelDockContainer2.Style.BorderColor.ColorSchemePart = eColorSchemePart.BarDockedBorder; this.panelDockContainer2.Style.ForeColor.ColorSchemePart = eColorSchemePart.ItemText; this.panelDockContainer2.Style.GradientAngle = 90; this.panelDockContainer2.TabIndex = 2; this.dockContainerItem1.Control = this.panelDockContainer1; this.dockContainerItem1.Name = "dockContainerItem1"; this.dockContainerItem1.Text = "日志"; this.dockContainerItem2.Control = this.panelDockContainer2; this.dockContainerItem2.Name = "dockContainerItem2"; this.dockContainerItem2.Text = "系统"; this.dockSite1.Dock = DockStyle.Left; this.dockSite1.DocumentDockContainer = new DocumentDockContainer(); this.dockSite1.Location = new Point(0, 0); this.dockSite1.Name = "dockSite1"; this.dockSite1.Size = new Size(0, 0x123); this.dockSite1.TabIndex = 0x1a; this.dockSite1.TabStop = false; this.dockSite2.Dock = DockStyle.Right; this.dockSite2.DocumentDockContainer = new DocumentDockContainer(); this.dockSite2.Location = new Point(0x265, 0); this.dockSite2.Name = "dockSite2"; this.dockSite2.Size = new Size(0, 0x123); this.dockSite2.TabIndex = 0x1b; this.dockSite2.TabStop = false; this.dockSite8.Dock = DockStyle.Bottom; this.dockSite8.Location = new Point(0, 0x1b5); this.dockSite8.Name = "dockSite8"; this.dockSite8.Size = new Size(0x265, 0); this.dockSite8.TabIndex = 0x21; this.dockSite8.TabStop = false; this.dockSite5.Dock = DockStyle.Left; this.dockSite5.Location = new Point(0, 0); this.dockSite5.Name = "dockSite5"; this.dockSite5.Size = new Size(0, 0x1b5); this.dockSite5.TabIndex = 30; this.dockSite5.TabStop = false; this.dockSite6.Dock = DockStyle.Right; this.dockSite6.Location = new Point(0x265, 0); this.dockSite6.Name = "dockSite6"; this.dockSite6.Size = new Size(0, 0x1b5); this.dockSite6.TabIndex = 0x1f; this.dockSite6.TabStop = false; this.dockSite7.Dock = DockStyle.Top; this.dockSite7.Location = new Point(0, 0); this.dockSite7.Name = "dockSite7"; this.dockSite7.Size = new Size(0x265, 0); this.dockSite7.TabIndex = 0x20; this.dockSite7.TabStop = false; this.dockSite3.Dock = DockStyle.Top; this.dockSite3.DocumentDockContainer = new DocumentDockContainer(); this.dockSite3.Location = new Point(0, 0); this.dockSite3.Name = "dockSite3"; this.dockSite3.Size = new Size(0x265, 0); this.dockSite3.TabIndex = 0x1c; this.dockSite3.TabStop = false; this.tabStrip1.AutoSelectAttachedControl = true; this.tabStrip1.CanReorderTabs = true; this.tabStrip1.CloseButtonVisible = false; this.tabStrip1.Dock = DockStyle.Top; this.tabStrip1.Location = new Point(0, 0); this.tabStrip1.MdiTabbedDocuments = true; this.tabStrip1.Name = "tabStrip1"; this.tabStrip1.SelectedTab = null; this.tabStrip1.SelectedTabFont = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0); this.tabStrip1.Size = new Size(0x265, 0x1a); this.tabStrip1.Style = eTabStripStyle.Office2007Document; this.tabStrip1.TabAlignment = eTabStripAlignment.Top; this.tabStrip1.TabIndex = 0x22; this.tabStrip1.TabLayoutType = eTabLayoutType.MultilineWithNavigationBox; this.tabStrip1.Text = "tabStrip1"; base.AutoScaleDimensions = new SizeF(6f, 12f); base.ClientSize = new Size(0x265, 0x1b5); base.Controls.Add(this.tabStrip1); base.Controls.Add(this.dockSite2); base.Controls.Add(this.dockSite1); base.Controls.Add(this.dockSite3); base.Controls.Add(this.dockSite4); base.Controls.Add(this.dockSite5); base.Controls.Add(this.dockSite6); base.Controls.Add(this.dockSite7); base.Controls.Add(this.dockSite8); base.Controls.Add(this.mdiClient1); base.IsMdiContainer = true; base.Name = "main"; this.Text = "anyEncoder编码器"; base.FormClosed += new FormClosedEventHandler(this.main_FormClosed); base.Load += new EventHandler(this.main_Load); this.dockSite4.ResumeLayout(false); this.bar1.EndInit(); this.bar1.ResumeLayout(false); this.panelDockContainer1.ResumeLayout(false); this.panelDockContainer1.PerformLayout(); base.ResumeLayout(false); }
private void btnOk_Click(object sender, EventArgs e) { if (listViewEx.CheckedItems.Count == 0) { return; } LayerList = new List <ILayer>(); for (int i = 0; i < Mapcontrol.Map.LayerCount; i++) { //IFeatureLayer featLay = Mapcontrol.Map.get_Layer(i) as IFeatureLayer; //changed by xisheng 20110828 ILayer mLayer = Mapcontrol.Map.get_Layer(i); if (mLayer is IGroupLayer) { ICompositeLayer pComLayer = mLayer as ICompositeLayer; for (int j = 0; j < pComLayer.Count; j++) { IFeatureLayer featLay = pComLayer.get_Layer(j) as IFeatureLayer; if (featLay == null) { continue; } if (!(featLay.FeatureClass as IDataset).Name.EndsWith("_GOH")) { continue; } LayerList.Add(featLay); } } else { IFeatureLayer featLay = Mapcontrol.Map.get_Layer(i) as IFeatureLayer; if (featLay == null) { continue; } if (!(featLay.FeatureClass as IDataset).Name.EndsWith("_GOH")) { continue; } LayerList.Add(featLay); } } LstArcGisMapControl = new List <AxMapControl>(); BarHistory.Items["dockItemHistoryData0"].Text = listViewEx.CheckedItems[0].Text; BarHistory.Items["dockItemHistoryData0"].Tooltip = listViewEx.CheckedItems[0].Text; ESRI.ArcGIS.Controls.AxMapControl axMapControlHistoryData = (BarHistory.Items["dockItemHistoryData0"] as DockContainerItem).Control.Controls[0] as AxMapControl; LstArcGisMapControl.Add(axMapControlHistoryData); for (int i = LayerList.Count - 1; i >= 0; i--) { IFeatureLayer layTemp = LayerList[i] as IFeatureLayer; IFeatureLayer pFeatureLayer = new FeatureLayerClass(); if (layTemp.FeatureClass.FeatureType == esriFeatureType.esriFTAnnotation) { pFeatureLayer = new FDOGraphicsLayerClass(); } else { (pFeatureLayer as IGeoFeatureLayer).Renderer = (layTemp as IGeoFeatureLayer).Renderer; } pFeatureLayer.FeatureClass = layTemp.FeatureClass; pFeatureLayer.Name = (layTemp.FeatureClass as IDataset).Name; IFeatureLayerDefinition featLayDefRes = null; if (m_Sel) { int fdIndex = layTemp.FeatureClass.Fields.FindField("SourceOID"); if (fdIndex == -1) { continue; } IFeatureLayerDefinition featLayDefTemp = layTemp as IFeatureLayerDefinition; IEnumIDs pEnumIDs = featLayDefTemp.DefinitionSelectionSet.IDs; int ID = pEnumIDs.Next(); StringBuilder sb = new StringBuilder(); while (ID != -1) { IFeature pFeat = layTemp.FeatureClass.GetFeature(ID); if (sb.Length != 0) { sb.Append(","); } sb.Append(pFeat.get_Value(fdIndex).ToString()); ID = pEnumIDs.Next(); } IQueryFilter queryFilter = new QueryFilterClass(); queryFilter.WhereClause = "SourceOID in (" + sb.ToString() + ")"; IFeatureSelection featSel = pFeatureLayer as IFeatureSelection; featSel.SelectFeatures(queryFilter, esriSelectionResultEnum.esriSelectionResultNew, false); featSel.SelectionChanged(); IFeatureLayerDefinition featLayDef = pFeatureLayer as IFeatureLayerDefinition; IFeatureLayer selFeatLay = featLayDef.CreateSelectionLayer(pFeatureLayer.Name, true, "", ""); IGeoFeatureLayer pGeoFeatureLayer = layTemp as IGeoFeatureLayer; if (pGeoFeatureLayer != null) { (selFeatLay as IGeoFeatureLayer).Renderer = pGeoFeatureLayer.Renderer; } axMapControlHistoryData.Map.AddLayer(selFeatLay); featLayDefRes = selFeatLay as IFeatureLayerDefinition; } else { axMapControlHistoryData.Map.AddLayer(pFeatureLayer); featLayDefRes = pFeatureLayer as IFeatureLayerDefinition; } featLayDefRes.DefinitionExpression = "FromDate<='" + listViewEx.CheckedItems[0].Text + "' and ToDate>'" + listViewEx.CheckedItems[0].Text + "'"; } axMapControlHistoryData.ActiveView.Extent = ArcGisMapControl.ActiveView.Extent; axMapControlHistoryData.ActiveView.Refresh(); for (int i = 1; i < listViewEx.CheckedItems.Count; i++) { DockContainerItem dockItemHistoryData = new DockContainerItem("dockItemHistoryData" + i.ToString(), listViewEx.CheckedItems[i].Text); dockItemHistoryData.Tooltip = listViewEx.CheckedItems[i].Text; PanelDockContainer PanelTipHistoryData = new PanelDockContainer(); dockItemHistoryData.Control = PanelTipHistoryData; BarHistory.Items.Add(dockItemHistoryData); } ArcGisMapControl.OnExtentUpdated += new IMapControlEvents2_Ax_OnExtentUpdatedEventHandler(ArcGisMapControl_OnExtentUpdated); ArcGisMapControl.OnViewRefreshed += new IMapControlEvents2_Ax_OnViewRefreshedEventHandler(ArcGisMapControl_OnViewRefreshed); this.Close(); }
public CDevListview(PanelDockContainer panelDockContainer1,int devnum) { this._intdevnum = devnum; groupPanel = new GroupPanel(); devlistViewEx = new ListViewEx(); label_devnum = new Label(); panelDockContainer1.Controls.Add(label_devnum); panelDockContainer1.Controls.Add(groupPanel); devlistViewEx.Border.Class = "ListViewBorder"; devlistViewEx.Dock = System.Windows.Forms.DockStyle.Fill; devlistViewEx.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); devlistViewEx.Location = new System.Drawing.Point(0, 0); devlistViewEx.Name = "devlistViewEx"; devlistViewEx.Size = new System.Drawing.Size(196, 171); devlistViewEx.TabIndex = 0; devlistViewEx.UseCompatibleStateImageBehavior = false; devlistViewEx.GridLines = true; devlistViewEx.FullRowSelect = true;//要选择就是一行 devlistViewEx.View = View.Details;//定义列表显示的方式 devlistViewEx.Scrollable = true;//需要时候显示滚动条 devlistViewEx.HeaderStyle = ColumnHeaderStyle.Nonclickable; devlistViewEx.Columns.Add("序号", devlistViewEx.Width * 1 / 6 + 7, HorizontalAlignment.Left); devlistViewEx.Columns.Add("姓名", devlistViewEx.Width * 2 / 6 - 4, HorizontalAlignment.Left); devlistViewEx.Columns.Add("证号", devlistViewEx.Width * 3 / 6 - 3, HorizontalAlignment.Left); groupPanel.BackColor = System.Drawing.Color.Transparent; groupPanel.CanvasColor = System.Drawing.SystemColors.Control; groupPanel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; groupPanel.Controls.Add(this.devlistViewEx); groupPanel.Location = new System.Drawing.Point(5, 12); groupPanel.Name = "groupPanel3"; groupPanel.Size = new System.Drawing.Size(202, 210); groupPanel.Visible = true; groupPanel.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; groupPanel.Style.BackColorGradientAngle = 90; groupPanel.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; groupPanel.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; groupPanel.Style.BorderBottomWidth = 1; groupPanel.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; groupPanel.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; groupPanel.Style.BorderLeftWidth = 1; groupPanel.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; groupPanel.Style.BorderRightWidth = 1; groupPanel.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; groupPanel.Style.BorderTopWidth = 1; groupPanel.Style.CornerDiameter = 4; groupPanel.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; groupPanel.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; groupPanel.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; groupPanel.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; groupPanel.TabIndex = 4; groupPanel.Text = "未连接"; label_devnum.AutoSize = true; label_devnum.BackColor = System.Drawing.Color.Transparent; label_devnum.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); label_devnum.ForeColor = System.Drawing.Color.Red; label_devnum.Location = new System.Drawing.Point(groupPanel.Left+6, groupPanel.Top-8); label_devnum.Name = "label1"; label_devnum.Size = new System.Drawing.Size(23, 24); label_devnum.Text = _intdevnum.ToString(); Status = DevStatus.未连接; // this.devlistViewEx.MouseDown += new System.Windows.Forms.MouseEventHandler(this.devlistViewEx_MouseDown); //初始化菜单 this.MyMenuStrip = new System.Windows.Forms.ContextMenuStrip(); this.MenuItem_clear = new System.Windows.Forms.ToolStripMenuItem(); this.MenuItem_del = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.MenuItem_showstu = new System.Windows.Forms.ToolStripMenuItem(); // MyMenuStrip // this.MyMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.MenuItem_clear, this.MenuItem_del, this.toolStripMenuItem1, this.MenuItem_showstu}); this.MyMenuStrip.Name = "MyMenuStrip"; this.MyMenuStrip.Size = new System.Drawing.Size(167, 76); // // 清除所以考生MenuItem_clear // this.MenuItem_clear.Name = "MenuItem_clear"; this.MenuItem_clear.Size = new System.Drawing.Size(166, 22); this.MenuItem_clear.Text = "清除所有考生"; this.MenuItem_clear.Click += new System.EventHandler(this.MenuItem_clear_Click); // // 删除对应考试MenuItem_del // this.MenuItem_del.Name = "MenuItem_del"; this.MenuItem_del.Size = new System.Drawing.Size(166, 22); this.MenuItem_del.Text = "删除对应考生"; this.MenuItem_del.Click += new System.EventHandler(this.MenuItem_del_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new System.Drawing.Size(163, 6); // // 显示考生详细信息MenuItem_showstu // this.MenuItem_showstu.Name = "MenuItem_showstu"; this.MenuItem_showstu.Size = new System.Drawing.Size(166, 22); this.MenuItem_showstu.Text = "显示考生详细信息"; this.MenuItem_showstu.Click += new System.EventHandler(this.MenuItem_showstu_Click); devlistViewEx.ContextMenuStrip = MyMenuStrip; }