private void InitRightTools() { Hashtable hashtb = new Command.ReadThempMaster().GetMasterFileList(); int i = 0; foreach (DictionaryEntry entry in hashtb) { ExplorerBarGroupItem groupitem = new ExplorerBarGroupItem(); groupitem.BackStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(241)))), ((int)(((byte)(245))))); groupitem.BackStyle.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; groupitem.BackStyle.BorderBottomWidth = 1; groupitem.BackStyle.BorderColor = System.Drawing.Color.White; groupitem.BackStyle.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; groupitem.BackStyle.BorderLeftWidth = 1; groupitem.BackStyle.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; groupitem.BackStyle.BorderRightWidth = 1; groupitem.Cursor = System.Windows.Forms.Cursors.Default; groupitem.ExpandBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(188)))), ((int)(((byte)(189)))), ((int)(((byte)(203))))); groupitem.Expanded = true; groupitem.ExpandForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(68)))), ((int)(((byte)(115))))); groupitem.ExpandHotBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(194)))), ((int)(((byte)(195)))), ((int)(((byte)(208))))); groupitem.ExpandHotForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(126)))), ((int)(((byte)(124)))), ((int)(((byte)(124))))); groupitem.Name = "explorerBarGroupItem" + i.ToString(); groupitem.Text = Path.GetFileName(entry.Key.ToString()) + "(模板示例)"; groupitem.TitleHotStyle.BackColor = System.Drawing.Color.White; groupitem.TitleHotStyle.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(215)))), ((int)(((byte)(224))))); groupitem.TitleHotStyle.CornerDiameter = 3; groupitem.TitleHotStyle.CornerTypeTopLeft = DevComponents.DotNetBar.eCornerType.Rounded; groupitem.TitleHotStyle.CornerTypeTopRight = DevComponents.DotNetBar.eCornerType.Rounded; groupitem.TitleHotStyle.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(126)))), ((int)(((byte)(124)))), ((int)(((byte)(124))))); groupitem.TitleStyle.BackColor = System.Drawing.Color.White; groupitem.TitleStyle.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(215)))), ((int)(((byte)(224))))); groupitem.TitleStyle.CornerDiameter = 3; groupitem.TitleStyle.CornerTypeTopLeft = DevComponents.DotNetBar.eCornerType.Rounded; groupitem.TitleStyle.CornerTypeTopRight = DevComponents.DotNetBar.eCornerType.Rounded; groupitem.TitleStyle.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(61)))), ((int)(((byte)(61))))); int j = 0; foreach (string str in (entry.Value as string[])) { ButtonItem bottonitem = new ButtonItem(); bottonitem.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; bottonitem.Cursor = System.Windows.Forms.Cursors.Hand; bottonitem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(61)))), ((int)(((byte)(61))))); bottonitem.HotFontUnderline = true; bottonitem.HotForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(126)))), ((int)(((byte)(124)))), ((int)(((byte)(124))))); bottonitem.HotTrackingStyle = DevComponents.DotNetBar.eHotTrackingStyle.None; bottonitem.Name = "buttonItem" + j++.ToString(); bottonitem.Text = Path.GetFileName(str); bottonitem.Click += new EventHandler(bottonitem_Click); groupitem.SubItems.Add(bottonitem); } explorerBar1.Groups.Add(groupitem); i++; } }
private void Form1_Load(object sender, System.EventArgs e) { ExplorerBarGroupItem group = new ExplorerBarGroupItem("group1", "Search"); group.SetDefaultAppearance(); explorerBar1.Groups.Add(group); LabelItem label = new LabelItem("searchLabel", "Search by any or all of the criteria below."); label.Stretch = true; label.WordWrap = true; label.Font = new Font(explorerBar1.Font, FontStyle.Bold); group.SubItems.Add(label); label = new LabelItem("searchLabel1", "All or part of the file name:"); label.Stretch = true; label.WordWrap = true; group.SubItems.Add(label); // Hosting Text Box on Explorer Bar TextBoxItem textItem = new TextBoxItem("txtFileName"); textItem.Stretch = true; group.SubItems.Add(textItem); // Hosting Label on Explorer Bar label = new LabelItem("searchLabel2", "Look in:"); label.Stretch = true; label.WordWrap = true; group.SubItems.Add(label); // Hosting Combo Box on Explorer Bar ComboBoxItem combo = new ComboBoxItem("cboLookIn"); combo.Stretch = true; DevComponents.Editors.ComboItem cboItem = new DevComponents.Editors.ComboItem(); cboItem.Text = "My Computer"; combo.Items.Add(cboItem); combo.SelectedIndex = 0; group.SubItems.Add(combo); group.Expanded = true; group = new ExplorerBarGroupItem("group2", "When was it modified?"); group.SetDefaultAppearance(); explorerBar1.Groups.Add(group); // Hosting any .NET controls on Explorer Bar in this case RadioButton // Don't remember Option ControlContainerItem cont = new ControlContainerItem("chk1", "Don't Remember"); RadioButton option = new RadioButton(); option.Name = "chkDontRemember"; option.Text = "Don't Remember"; option.Font = new Font(explorerBar1.Font, FontStyle.Bold); option.Checked = true; option.BackColor = Color.Transparent; cont.Control = option; group.SubItems.Add(cont); // Within last week cont = new ControlContainerItem("chk1", "Within last week"); option = new RadioButton(); option.Name = "chkLastweek"; option.Text = "Within last week"; option.BackColor = Color.Transparent; cont.Control = option; group.SubItems.Add(cont); // Past month cont = new ControlContainerItem("chk1", "Past month"); option = new RadioButton(); option.Name = "chkLastMonth"; option.Text = "Past month"; option.BackColor = Color.Transparent; cont.Control = option; group.SubItems.Add(cont); // Within the past year cont = new ControlContainerItem("chk1", "Within the past year"); option = new RadioButton(); option.Name = "chkLastYear"; option.Text = "Within the past year"; option.BackColor = Color.Transparent; cont.Control = option; group.SubItems.Add(cont); group = new ExplorerBarGroupItem("group3", "Additional Options"); group.SetDefaultAppearance(); explorerBar1.Groups.Add(group); group.Expanded = true; // Other Search Options ButtonItem btn = new ButtonItem("bSearchOptions", "Other search options"); btn.HotFontUnderline = true; btn.HotTrackingStyle = eHotTrackingStyle.None; btn.Image = new Bitmap(this.GetType(), "Options.png"); btn.ImagePosition = eImagePosition.Left; btn.ButtonStyle = eButtonStyle.ImageAndText; btn.Cursor = Cursors.Hand; group.SubItems.Add(btn); // Change Preferences btn = new ButtonItem("bPreferences", "Change Preferences"); btn.HotFontUnderline = true; btn.HotTrackingStyle = eHotTrackingStyle.None; btn.Image = new Bitmap(this.GetType(), "Preferences.png"); btn.ImagePosition = eImagePosition.Left; btn.ButtonStyle = eButtonStyle.ImageAndText; btn.Cursor = Cursors.Hand; group.SubItems.Add(btn); // Applies all layout changes and refreshes display explorerBar1.RecalcLayout(); }