public MainForm () { components = new Container (); ComponentResourceManager resources = new ComponentResourceManager (typeof (MainForm)); menuStrip = new MenuStrip (); fileMenu = new ToolStripMenuItem (); openToolStripMenuItem = new ToolStripMenuItem (); reopenToolStripMenuItem = new ToolStripMenuItem (); closeToolStripMenuItem = new ToolStripMenuItem (); snipperToolStripMenuItem = new ToolStripMenuItem (); toolStripSeparator4 = new ToolStripSeparator (); exitToolStripMenuItem = new ToolStripMenuItem (); copyToolStripMenuItem = new ToolStripMenuItem (); viewMenu = new ToolStripMenuItem (); editMenu = new ToolStripMenuItem (); toolBarToolStripMenuItem = new ToolStripMenuItem (); statusBarToolStripMenuItem = new ToolStripMenuItem (); sourceViewToolStripMenuItem = new ToolStripMenuItem (); timeZoneToolStripMenuItem = new ToolStripMenuItem (); timeZoneMyLocalToolStripMenuItem = new ToolStripMenuItem (); timeZoneLogLocalToolStripMenuItem = new ToolStripMenuItem (); timeZoneUniversalToolStripMenuItem = new ToolStripMenuItem (); timeZoneCycleToolStripMenuItem = new ToolStripMenuItem (); toolsMenu = new ToolStripMenuItem (); optionsToolStripMenuItem = new ToolStripMenuItem (); traceConfigToolStripMenuItem = new ToolStripMenuItem (); windowsMenu = new ToolStripMenuItem (); cascadeToolStripMenuItem = new ToolStripMenuItem (); tileVerticalToolStripMenuItem = new ToolStripMenuItem (); tileHorizontalToolStripMenuItem = new ToolStripMenuItem (); closeAllToolStripMenuItem = new ToolStripMenuItem (); arrangeIconsToolStripMenuItem = new ToolStripMenuItem (); helpMenu = new ToolStripMenuItem (); contentsToolStripMenuItem = new ToolStripMenuItem (); indexToolStripMenuItem = new ToolStripMenuItem (); searchToolStripMenuItem = new ToolStripMenuItem (); toolStripSeparator8 = new ToolStripSeparator (); aboutToolStripMenuItem = new ToolStripMenuItem (); toolStrip = new ToolStrip (); newToolStripButton = new ToolStripButton (); openToolStripButton = new ToolStripButton (); saveToolStripButton = new ToolStripButton (); toolStripSeparator1 = new ToolStripSeparator (); printToolStripButton = new ToolStripButton (); printPreviewToolStripButton = new ToolStripButton (); helpToolStripButton = new ToolStripButton (); statusStrip = new StatusStrip (); toolStripStatusLabel = new ToolStripStatusLabel (); menuStrip.SuspendLayout (); toolStrip.SuspendLayout (); statusStrip.SuspendLayout (); SuspendLayout (); // // menuStrip // menuStrip.Items.AddRange (new ToolStripItem [] { fileMenu, editMenu, viewMenu, toolsMenu, windowsMenu, helpMenu}); menuStrip.Location = new Point (0, 0); menuStrip.MdiWindowListItem = windowsMenu; menuStrip.Size = new Size (632, 24); menuStrip.TabIndex = 0; menuStrip.Text = "MenuStrip"; // // fileMenu // fileMenu.DropDownItems.AddRange (new ToolStripItem [] { openToolStripMenuItem, reopenToolStripMenuItem, closeToolStripMenuItem, snipperToolStripMenuItem, toolStripSeparator4, exitToolStripMenuItem}); fileMenu.ImageTransparentColor = SystemColors.ActiveBorder; fileMenu.Size = new Size (35, 20); fileMenu.MergeAction = MergeAction.Append; fileMenu.MergeIndex = 1; fileMenu.Text = "&File"; // // openToolStripMenuItem // openToolStripMenuItem.Image = ((Image) (resources.GetObject ("openToolStripMenuItem.Image"))); openToolStripMenuItem.ImageTransparentColor = Color.Black; openToolStripMenuItem.ShortcutKeys = ((Keys) ((Keys.Control | Keys.O))); openToolStripMenuItem.Size = new Size (151, 22); openToolStripMenuItem.Text = "&Open"; openToolStripMenuItem.Click += new System.EventHandler (OpenFile); openToolStripMenuItem.MergeAction = MergeAction.Append; openToolStripMenuItem.MergeIndex = 2; // // reopenToolStripMenuItem // reopenToolStripMenuItem.Image = ((Image) (resources.GetObject ("openToolStripMenuItem.Image"))); reopenToolStripMenuItem.ImageTransparentColor = Color.Black; reopenToolStripMenuItem.Size = new Size (151, 22); reopenToolStripMenuItem.Text = "&Reopen"; reopenToolStripMenuItem.MergeAction = MergeAction.Append; reopenToolStripMenuItem.MergeIndex = 3; // // closeToolStripMenuItem // //is.closeToolStripMenuItem.Image = ((Image)(resources.GetObject("saveToolStripMenuItem.Image"))); closeToolStripMenuItem.ImageTransparentColor = Color.Black; //is.closeToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control | Keys.S))); closeToolStripMenuItem.Size = new Size (151, 22); closeToolStripMenuItem.Text = "&Close"; closeToolStripMenuItem.MergeAction = MergeAction.Append; closeToolStripMenuItem.MergeIndex = 5; // // snipperToolStripMenuItem // snipperToolStripMenuItem.Size = new Size (151, 22); snipperToolStripMenuItem.Text = "Snip/Merge Log File(s)..."; snipperToolStripMenuItem.MergeAction = MergeAction.Append; snipperToolStripMenuItem.MergeIndex = 6; // // toolStripSeparator4 // toolStripSeparator4.Size = new Size (148, 6); toolStripSeparator4.MergeAction = MergeAction.Append; toolStripSeparator4.MergeIndex = 7; // // exitToolStripMenuItem // exitToolStripMenuItem.Size = new Size (151, 22); exitToolStripMenuItem.Text = "E&xit"; exitToolStripMenuItem.Click += new System.EventHandler (ExitToolsStripMenuItem_Click); exitToolStripMenuItem.MergeAction = MergeAction.Append; exitToolStripMenuItem.MergeIndex = 11; // // editMenu // editMenu.DropDownItems.Add (copyToolStripMenuItem); editMenu.Size = new Size (41, 20); editMenu.Text = "&Edit"; editMenu.MergeAction = MergeAction.Append; // // copyToolStripMenuItem // copyToolStripMenuItem.MergeAction = MergeAction.Append; copyToolStripMenuItem.MergeIndex = 1; copyToolStripMenuItem.Size = new Size (190, 22); copyToolStripMenuItem.Text = "Copy"; copyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C"; copyToolStripMenuItem.ShowShortcutKeys = true; copyToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C; // // viewMenu // viewMenu.DropDownItems.AddRange (new ToolStripItem [] { toolBarToolStripMenuItem, statusBarToolStripMenuItem, sourceViewToolStripMenuItem, timeZoneToolStripMenuItem}); viewMenu.Size = new Size (41, 20); viewMenu.Text = "&View"; viewMenu.MergeAction = MergeAction.Append; // // toolBarToolStripMenuItem // toolBarToolStripMenuItem.Checked = true; toolBarToolStripMenuItem.CheckOnClick = true; toolBarToolStripMenuItem.CheckState = CheckState.Checked; toolBarToolStripMenuItem.Size = new Size (135, 22); toolBarToolStripMenuItem.Text = "&Toolbar"; toolBarToolStripMenuItem.Click += new System.EventHandler (ToolBarToolStripMenuItem_Click); toolBarToolStripMenuItem.MergeAction = MergeAction.Append; toolBarToolStripMenuItem.MergeIndex = 68; // // statusBarToolStripMenuItem // statusBarToolStripMenuItem.Checked = true; statusBarToolStripMenuItem.CheckOnClick = true; statusBarToolStripMenuItem.CheckState = CheckState.Checked; statusBarToolStripMenuItem.Size = new Size (135, 22); statusBarToolStripMenuItem.Text = "&Status Bar"; statusBarToolStripMenuItem.Click += new System.EventHandler (StatusBarToolStripMenuItem_Click); statusBarToolStripMenuItem.MergeAction = MergeAction.Append; statusBarToolStripMenuItem.MergeIndex = 99; // // sourceViewToolStripMenuItem // sourceViewToolStripMenuItem.Checked = true; sourceViewToolStripMenuItem.CheckOnClick = true; sourceViewToolStripMenuItem.CheckState = CheckState.Checked; sourceViewToolStripMenuItem.Size = new Size (135, 22); sourceViewToolStripMenuItem.Text = "Source &View"; sourceViewToolStripMenuItem.MergeAction = MergeAction.Append; sourceViewToolStripMenuItem.MergeIndex = 100; // // timeZoneToolStripMenuItem // timeZoneToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem [] { timeZoneMyLocalToolStripMenuItem, timeZoneLogLocalToolStripMenuItem, timeZoneUniversalToolStripMenuItem, timeZoneCycleToolStripMenuItem}); timeZoneToolStripMenuItem.Size = new Size (41, 20); timeZoneToolStripMenuItem.Text = "Time Zone Setting"; timeZoneToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneToolStripMenuItem.MergeIndex = 10; // // timeZoneMyLocalToolStripMenuItem // timeZoneMyLocalToolStripMenuItem.Size = new Size (135, 22); timeZoneMyLocalToolStripMenuItem.Text = "My &Local Time Zone"; timeZoneMyLocalToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneMyLocalToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneMyLocalToolStripMenuItem.ShowShortcutKeys = true; timeZoneMyLocalToolStripMenuItem.ShortcutKeys = Keys.None; // // timeZoneLogLocalToolStripMenuItem // timeZoneLogLocalToolStripMenuItem.Size = new Size (135, 22); timeZoneLogLocalToolStripMenuItem.Text = "Log &Creator's Time Zone"; timeZoneLogLocalToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneLogLocalToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneLogLocalToolStripMenuItem.ShowShortcutKeys = true; timeZoneLogLocalToolStripMenuItem.ShortcutKeys = Keys.None; // // timeZoneUniversalToolStripMenuItem // timeZoneUniversalToolStripMenuItem.Size = new Size (135, 22); timeZoneUniversalToolStripMenuItem.Text = "&Universal Coordinated Time"; timeZoneUniversalToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneUniversalToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneUniversalToolStripMenuItem.ShowShortcutKeys = true; timeZoneUniversalToolStripMenuItem.ShortcutKeys = Keys.None; // // timeZoneCycleToolStripMenuItem // timeZoneCycleToolStripMenuItem.Size = new Size (135, 22); timeZoneCycleToolStripMenuItem.Text = "Cycle Time Zones"; timeZoneCycleToolStripMenuItem.MergeAction = MergeAction.Append; timeZoneCycleToolStripMenuItem.Visible = false; timeZoneCycleToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+T"; timeZoneCycleToolStripMenuItem.ShowShortcutKeys = true; timeZoneCycleToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Shift | Keys.T; // // toolsMenu // toolsMenu.DropDownItems.AddRange (new ToolStripItem [] { optionsToolStripMenuItem, traceConfigToolStripMenuItem}); toolsMenu.Size = new Size (44, 20); toolsMenu.Text = "&Tools"; // // optionsToolStripMenuItem // optionsToolStripMenuItem.Size = new Size (122, 22); optionsToolStripMenuItem.Text = "&Options..."; // // traceConfigToolStripMenuItem // traceConfigToolStripMenuItem.Size = new Size (122, 22); traceConfigToolStripMenuItem.Text = "Launch Trace&Config"; // // windowsMenu // windowsMenu.DropDownItems.AddRange (new ToolStripItem [] { cascadeToolStripMenuItem, tileVerticalToolStripMenuItem, tileHorizontalToolStripMenuItem, closeAllToolStripMenuItem, arrangeIconsToolStripMenuItem}); windowsMenu.Size = new Size (62, 20); windowsMenu.Text = "&Windows"; // // cascadeToolStripMenuItem // cascadeToolStripMenuItem.Size = new Size (153, 22); cascadeToolStripMenuItem.Text = "&Cascade"; cascadeToolStripMenuItem.Click += new System.EventHandler (CascadeToolStripMenuItem_Click); // // tileVerticalToolStripMenuItem // tileVerticalToolStripMenuItem.Size = new Size (153, 22); tileVerticalToolStripMenuItem.Text = "Tile &Vertical"; // // tileHorizontalToolStripMenuItem // tileHorizontalToolStripMenuItem.Size = new Size (153, 22); tileHorizontalToolStripMenuItem.Text = "Tile &Horizontal"; tileHorizontalToolStripMenuItem.Click += new System.EventHandler (TileHorizontalToolStripMenuItem_Click); // // closeAllToolStripMenuItem // closeAllToolStripMenuItem.Size = new Size (153, 22); closeAllToolStripMenuItem.Text = "C&lose All"; closeAllToolStripMenuItem.Click += new System.EventHandler (CloseAllToolStripMenuItem_Click); // // arrangeIconsToolStripMenuItem // arrangeIconsToolStripMenuItem.Size = new Size (153, 22); arrangeIconsToolStripMenuItem.Text = "&Arrange Icons"; arrangeIconsToolStripMenuItem.Click += new System.EventHandler (ArrangeIconsToolStripMenuItem_Click); // // helpMenu // helpMenu.DropDownItems.AddRange (new ToolStripItem [] { contentsToolStripMenuItem, indexToolStripMenuItem, searchToolStripMenuItem, toolStripSeparator8, aboutToolStripMenuItem}); helpMenu.Size = new Size (40, 20); helpMenu.Text = "&Help"; // // contentsToolStripMenuItem // contentsToolStripMenuItem.ShortcutKeys = ((Keys) ((Keys.Control | Keys.F1))); contentsToolStripMenuItem.Size = new Size (173, 22); contentsToolStripMenuItem.Text = "&Contents"; // // indexToolStripMenuItem // indexToolStripMenuItem.Image = ((Image) (resources.GetObject ("indexToolStripMenuItem.Image"))); indexToolStripMenuItem.ImageTransparentColor = Color.Black; indexToolStripMenuItem.Size = new Size (173, 22); indexToolStripMenuItem.Text = "&Index"; // // searchToolStripMenuItem // searchToolStripMenuItem.Image = ((Image) (resources.GetObject ("searchToolStripMenuItem.Image"))); searchToolStripMenuItem.ImageTransparentColor = Color.Black; searchToolStripMenuItem.Size = new Size (173, 22); searchToolStripMenuItem.Text = "&Search"; // // toolStripSeparator8 // toolStripSeparator8.Size = new Size (170, 6); // // aboutToolStripMenuItem // aboutToolStripMenuItem.Size = new Size (173, 22); aboutToolStripMenuItem.Text = "&About ..."; // // toolStrip // toolStrip.Items.AddRange (new ToolStripItem [] { newToolStripButton, openToolStripButton, saveToolStripButton, toolStripSeparator1, printToolStripButton, printPreviewToolStripButton, helpToolStripButton}); toolStrip.Location = new Point (0, 24); toolStrip.Size = new Size (632, 25); toolStrip.TabIndex = 1; toolStrip.Text = "ToolStrip"; // // newToolStripButton // newToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; newToolStripButton.Image = ((Image) (resources.GetObject ("newToolStripButton.Image"))); newToolStripButton.ImageTransparentColor = Color.Black; newToolStripButton.Text = "New"; newToolStripButton.Click += new System.EventHandler (ShowNewForm); // // openToolStripButton // openToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; openToolStripButton.Image = ((Image) (resources.GetObject ("openToolStripButton.Image"))); openToolStripButton.ImageTransparentColor = Color.Black; openToolStripButton.Text = "Open"; openToolStripButton.Click += new System.EventHandler (OpenFile); // // saveToolStripButton // saveToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; saveToolStripButton.Image = ((Image) (resources.GetObject ("saveToolStripButton.Image"))); saveToolStripButton.ImageTransparentColor = Color.Black; saveToolStripButton.Text = "Save"; // // toolStripSeparator1 // // // printToolStripButton // printToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; printToolStripButton.Image = ((Image) (resources.GetObject ("printToolStripButton.Image"))); printToolStripButton.ImageTransparentColor = Color.Black; printToolStripButton.Text = "Print"; // // printPreviewToolStripButton // printPreviewToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; printPreviewToolStripButton.Image = ((Image) (resources.GetObject ("printPreviewToolStripButton.Image"))); printPreviewToolStripButton.ImageTransparentColor = Color.Black; printPreviewToolStripButton.Text = "Print Preview"; // // helpToolStripButton // helpToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; helpToolStripButton.Image = ((Image) (resources.GetObject ("helpToolStripButton.Image"))); helpToolStripButton.ImageTransparentColor = Color.Black; helpToolStripButton.Text = "Help"; // // statusStrip // statusStrip.Items.Add (toolStripStatusLabel); statusStrip.LayoutStyle = ToolStripLayoutStyle.Table; statusStrip.Location = new Point (0, 433); statusStrip.Size = new Size (632, 20); statusStrip.TabIndex = 2; statusStrip.Text = "StatusStrip"; // // toolStripStatusLabel // toolStripStatusLabel.Text = "Status"; // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (400, 300); Controls.Add (statusStrip); Controls.Add (toolStrip); Controls.Add (menuStrip); IsMdiContainer = true; Location = new Point (200, 100); MainMenuStrip = menuStrip; StartPosition = FormStartPosition.Manual; Text = "bug #81477"; menuStrip.ResumeLayout (false); toolStrip.ResumeLayout (false); statusStrip.ResumeLayout (false); ResumeLayout (false); PerformLayout (); Load += new EventHandler (MainForm_Load); }
//**************************************** public WinToolbar(ToolbarDef template, ToolStrip toolStrip, object target) { //**************************************** WinToolItem NewItem; //**************************************** _ToolStrip = toolStrip; _Children = new List <WinToolItem>(); //**************************************** toolStrip.SuspendLayout(); foreach (ToolbarItemDef ChildItem in template.Items) { if (ChildItem == null || ChildItem.Style == null) { toolStrip.Items.Add(new ToolStripSeparator()); continue; } NewItem = new WinToolItem(ChildItem, target); _Children.Add(NewItem); toolStrip.Items.Add(NewItem.Item); } toolStrip.ResumeLayout(); }
protected override void OnLeaveState() { // Unregister events DualityEditorApp.SelectionChanged -= this.DualityEditorApp_SelectionChanged; DualityEditorApp.ObjectPropertyChanged -= this.DualityEditorApp_ObjectPropertyChanged; this.View.SuspendLayout(); toolstrip.SuspendLayout(); toolstrip.Items.Clear(); this.View.Controls.Remove(toolstrip); toolstrip.Dispose(); toolstrip.ResumeLayout(true); this.View.ResumeLayout(true); base.OnLeaveState(); this.View.SetToolbarCamSettingsEnabled(true); this.CameraObj.Active = true; if (selectedBody != null) { selectedBody.IsSelected = false; selectedBody = null; } }
protected void RefreshBreadcrumbs() { if (DrilldownStack.Count == 0) { Breadcrumbs.Visible = false; return; } Breadcrumbs.SuspendLayout(); var items = DrilldownStack.Reverse().ToArray(); while (Breadcrumbs.Items.Count > DrilldownStack.Count + 1) { Breadcrumbs.Items.RemoveAt(Breadcrumbs.Items.Count - 1); } while (DrilldownStack.Count + 1 > Breadcrumbs.Items.Count) { var index = Breadcrumbs.Items.Count - 1; Breadcrumbs.Items.Add(GetItemText(items[index])).Click += BreadcrumbClick; } for (var i = 0; i < items.Length; i++) { var btn = Breadcrumbs.Items[i + 1] as ToolStripButton; btn.Text = GetItemText(items[i]); btn.Checked = false; } (Breadcrumbs.Items[Breadcrumbs.Items.Count - 1] as ToolStripButton).Checked = true; Breadcrumbs.ResumeLayout(true); Breadcrumbs.Visible = (DrilldownStack.Count > 0); }
/// <summary> /// Called to build menus and toolbars. Override this method to customize menu and toolbar building. /// </summary> /// <remarks> /// The default implementation simply clears and re-creates the toolstrip using methods on the /// utility class <see cref="ToolStripBuilder"/>. /// </remarks> /// <param name="kind"></param> /// <param name="toolStrip"></param> /// <param name="actionModel"></param> protected virtual void BuildToolStrip(ToolStripBuilder.ToolStripKind kind, ToolStrip toolStrip, ActionModelNode actionModel) { // avoid flicker toolStrip.SuspendLayout(); // very important to clean up the existing ones first ToolStripBuilder.Clear(toolStrip.Items); if (actionModel != null) { if (actionModel.ChildNodes.Count > 0) { // Toolstrip should only be visible if there are items on it if (kind == ToolStripBuilder.ToolStripKind.Toolbar) { ToolStripBuilder.BuildToolStrip(kind, toolStrip.Items, actionModel.ChildNodes, ToolStripBuilder.ToolStripBuilderStyle.GetDefault(), ToolStripSettings.Default.IconSize); } else { ToolStripBuilder.BuildToolStrip(kind, toolStrip.Items, actionModel.ChildNodes); } } } toolStrip.ResumeLayout(); }
//public Panel TopToolsPanel { get { return _topToolsPanel; } } //public Panel EditPanel { get { return _editPanel; } } //public ToolStrip BottomToolStrip { get { return _bottomToolStrip; } } public void InitializeForm() { this.SuspendLayout(); this.AutoScaleDimensions = new SizeF(6F, 13F); this.AutoScaleMode = AutoScaleMode.Font; //this.Controls.Add(_bottomToolsPanel); //this.Controls.Add(_resultTab); this.Controls.Add(_resultTab); this.Controls.Add(_bottomToolsPanel); this.Controls.Add(zForm.CreateSplitter(DockStyle.Top)); this.Controls.Add(_editPanel); this.Controls.Add(_topToolsPanel); this.Controls.Add(this.MainMenuStrip); //WriteMessage("before PerformLayout"); //TraceResultTab(); // active message tab //ActivePanResult(_messageTabIndex); this.MainMenuStrip.ResumeLayout(false); _topToolsPanel.ResumeLayout(false); _editPanel.ResumeLayout(false); _resultTab.ResumeLayout(false); _bottomToolStrip.ResumeLayout(false); _bottomToolsPanel.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); //WriteMessage("after PerformLayout"); //TraceResultTab(); }
public static void ChangeIconSize(ToolStrip toolStrip, IconSize iconSize) { toolStrip.SuspendLayout(); toolStrip.ImageScalingSize = StandardIconSizes.GetSize(iconSize); ChangeIconSize(toolStrip.Items, iconSize); toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripButton1 = new System.Windows.Forms.ToolStripButton(); toolStrip1.SuspendLayout(); SuspendLayout(); // <Snippet1> // This is an example of some common ToolStrip property settings. // toolStrip1.AllowDrop = false; toolStrip1.AllowItemReorder = true; toolStrip1.AllowMerge = false; toolStrip1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); toolStrip1.AutoSize = false; toolStrip1.CanOverflow = false; toolStrip1.Cursor = System.Windows.Forms.Cursors.Cross; toolStrip1.DefaultDropDownDirection = System.Windows.Forms.ToolStripDropDownDirection.BelowRight; toolStrip1.Dock = System.Windows.Forms.DockStyle.None; toolStrip1.GripMargin = new System.Windows.Forms.Padding(3); toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripButton1 }); toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Margin = new System.Windows.Forms.Padding(1); toolStrip1.Name = "toolStrip1"; toolStrip1.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0); toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; toolStrip1.ShowItemToolTips = false; toolStrip1.Size = new System.Drawing.Size(109, 273); toolStrip1.Stretch = true; toolStrip1.TabIndex = 0; toolStrip1.TabStop = true; toolStrip1.Text = "toolStrip1"; toolStrip1.TextDirection = System.Windows.Forms.ToolStripTextDirection.Vertical90; // </Snippet1> // toolStripButton1 // toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; toolStripButton1.Name = "toolStripButton1"; toolStripButton1.Size = new System.Drawing.Size(23, 270); toolStripButton1.Text = "toolStripButton1"; // // Form1 // ClientSize = new System.Drawing.Size(292, 273); Controls.Add(toolStrip1); Name = "Form1"; toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); }
private void InitializeComponent() { toolStrip = new ToolStrip(); btnSizeToFit = new ToolStripButton(); btnZoomIn = new ToolStripButton(); btnZoomOut = new ToolStripButton(); cbZoomLevels = new ToolStripComboBox(); imageBox = new ImageBox(); toolStrip.SuspendLayout(); SuspendLayout(); toolStrip.Items.AddRange(new ToolStripItem[] { btnSizeToFit, btnZoomIn, btnZoomOut, new ToolStripSeparator(), cbZoomLevels, new ToolStripSeparator() }); btnSizeToFit.DisplayStyle = ToolStripItemDisplayStyle.Image; btnSizeToFit.Image = UIHelper.LoadResourceImage("Resources.btn_size_to_fit.png"); btnSizeToFit.ImageTransparentColor = Color.Magenta; btnSizeToFit.Name = "btnSizeToFit"; btnSizeToFit.Click += btnSizeToFit_Click; btnZoomIn.DisplayStyle = ToolStripItemDisplayStyle.Image; btnZoomIn.Image = UIHelper.LoadResourceImage("Resources.btn_zoom_in.png"); btnZoomIn.ImageTransparentColor = Color.Magenta; btnZoomIn.Name = "btnZoomIn"; btnZoomIn.Click += btnZoomIn_Click; btnZoomOut.DisplayStyle = ToolStripItemDisplayStyle.Image; btnZoomOut.Image = UIHelper.LoadResourceImage("Resources.btn_zoom_out.png"); btnZoomOut.ImageTransparentColor = Color.Magenta; btnZoomOut.Name = "btnZoomOut"; btnZoomOut.Click += btnZoomOut_Click; cbZoomLevels.DropDownStyle = ComboBoxStyle.DropDownList; cbZoomLevels.Name = "zoomLevelsToolStripComboBox"; cbZoomLevels.Size = new Size(140, 28); cbZoomLevels.SelectedIndexChanged += cbZoomLevels_SelectedIndexChanged; imageBox.BackColor = SystemColors.ControlDark; imageBox.Dock = DockStyle.Fill; imageBox.ZoomChanged += imageBox_ZoomChanged; Controls.Add(imageBox); Controls.Add(toolStrip); Size = new Size(944, 389); toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void InitializeComponent() { toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); toolStrip1.SuspendLayout(); SuspendLayout(); // // toolStrip1 // toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripComboBox1 }); toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new System.Drawing.Size(292, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; // <Snippet1> // The following code example demonstrates the syntax for setting // various ToolStripComboBox properties. // toolStripComboBox1.AutoCompleteCustomSource.AddRange(new string[] { "aaa", "bbb", "ccc" }); toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; toolStripComboBox1.DropDownHeight = 110; toolStripComboBox1.DropDownWidth = 122; toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard; toolStripComboBox1.IntegralHeight = false; toolStripComboBox1.Items.AddRange(new object[] { "xxx", "yyy", "zzz" }); toolStripComboBox1.MaxDropDownItems = 9; toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert; toolStripComboBox1.Name = "toolStripComboBox1"; toolStripComboBox1.Size = new System.Drawing.Size(121, 25); toolStripComboBox1.Sorted = true; // </Snippet1> // // Form1 // ClientSize = new System.Drawing.Size(292, 273); Controls.Add(toolStrip1); Name = "Form1"; toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); PerformLayout(); }
public PropertyGridEx() { var originalToolStrip = (ToolStrip)this.GetType().BaseType.InvokeMember("toolStrip", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance, null, this, null); Controls.Remove(originalToolStrip); toolStrip = new ToolStripEx() { ClickThrough = true }; this.GetType().BaseType.InvokeMember("toolStrip", BindingFlags.NonPublic | BindingFlags.SetField | BindingFlags.Instance, null, this, new object[] { toolStrip }); toolStrip.SuspendLayout(); toolStrip.ShowItemToolTips = true; toolStrip.AccessibleName = "PropertyGridToolbarAccessibleName"; toolStrip.AccessibleRole = AccessibleRole.ToolBar; toolStrip.TabStop = true; toolStrip.AllowMerge = false; toolStrip.ShowItemToolTips = true; // This caption is for testing. toolStrip.Text = "PropertyGridToolBar"; // LayoutInternal handles positioning, and for perf reasons, we manually size. toolStrip.Dock = DockStyle.None; toolStrip.AutoSize = false; toolStrip.TabIndex = 1; toolStrip.ImageScalingSize = new Size(16, 16); // parity with the old... toolStrip.CanOverflow = false; // hide the grip but add in a few more pixels of padding. toolStrip.GripStyle = ToolStripGripStyle.Hidden; var toolStripPadding = toolStrip.Padding; toolStripPadding.Left = 2; toolStrip.Padding = toolStripPadding; SetToolStripRenderer(); var mii = this.GetType().BaseType.GetMethod("AddRefTab", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); mii.Invoke(this, new object[] { DefaultTabType, null, PropertyTabScope.Static, true }); toolStrip.ResumeLayout(false); // SetupToolbar should perform the layout Controls.Add(toolStrip); var mi = this.GetType().BaseType.GetMethod("SetupToolbar", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, Type.DefaultBinder, new Type[] { typeof(bool) }, null); mi.Invoke(this, new object[] { true }); this.PropertySort = PropertySort.Categorized | PropertySort.Alphabetical; this.Text = "PropertyGrid"; var miii = this.GetType().BaseType.GetMethod("SetSelectState", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); miii.Invoke(this, new object[] { 0 }); }
public void RegisteButton(IList buttons) { _toolStrip.SuspendLayout(); _toolStrip.Items.Clear(); foreach (IButtonInfo bi in buttons) { ToolStripButton btn = bi.Button as ToolStripButton; _toolStrip.Items.Add(btn); } _toolStrip.ResumeLayout(); }
public static void UpdateToolbarText(ToolStrip toolStrip) { toolStrip.SuspendLayout(); foreach (ToolStripItem item in toolStrip.Items) { if (item is IStatusUpdate) { ((IStatusUpdate)item).UpdateText(); } } toolStrip.ResumeLayout(); }
private void InitializeComponent() { toolStrip1 = new System.Windows.Forms.ToolStrip(); toolStripTextBox1 = new System.Windows.Forms.ToolStripTextBox(); toolStrip1.SuspendLayout(); SuspendLayout(); // // toolStrip1 // toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripTextBox1 }); toolStrip1.Location = new System.Drawing.Point(0, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new System.Drawing.Size(292, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; // <Snippet1> // This code example demonstrates the syntax for setting // various ToolStripTextBox properties. // toolStripTextBox1.AcceptsReturn = true; toolStripTextBox1.AcceptsTab = true; toolStripTextBox1.AutoCompleteCustomSource.AddRange(new string[] { "This is line one.", "Second line.", "Another line." }); toolStripTextBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; toolStripTextBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; toolStripTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; toolStripTextBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; toolStripTextBox1.HideSelection = false; toolStripTextBox1.MaxLength = 32000; toolStripTextBox1.Name = "toolStripTextBox1"; toolStripTextBox1.ShortcutsEnabled = false; toolStripTextBox1.Size = new System.Drawing.Size(100, 25); toolStripTextBox1.Text = "STRING1\r\nSTRING2\r\nSTRING3\r\nSTRING4"; toolStripTextBox1.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center; // </Snippet1> // // Form1 // ClientSize = new System.Drawing.Size(292, 273); Controls.Add(toolStrip1); Name = "Form1"; toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void LoadFavoritesToolbar() { try { favoriteToolBar.SuspendLayout(); ClearFavoriteButtons(); CreateFavoriteButtons(); favoriteToolBar.ResumeLayout(); } catch (Exception exc) { Logging.Error("Error Loading Favorites Toolbar", exc); } }
protected void CreateMenu(ToolStripContainer container, Action <ToolStrip> itemsInitializer) { MainMenuControl = new ToolStrip(); MainMenuControl.SuspendLayout(); container.TopToolStripPanel.Controls.Add(MainMenuControl); MainMenuControl.Dock = DockStyle.None; itemsInitializer(MainMenuControl); MainMenuControl.Location = new Point(3, 0); MainMenuControl.Name = "mainMenuControl"; MainMenuControl.Size = new Size(478, 25); MainMenuControl.TabIndex = 1; MainMenuControl.ResumeLayout(false); MainMenuControl.PerformLayout(); }
private void CreateToolsPanel() { ToolStrip toolStrip1 = new ToolStrip(); toolStrip1.SuspendLayout(); toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 1", (sender, eventArgs) => ActiveTabPanel(0))); toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 2", (sender, eventArgs) => ActiveTabPanel(1))); toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 3", (sender, eventArgs) => ActiveTabPanel(2))); toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 4", (sender, eventArgs) => ActiveTabPanel(3))); toolStrip1.Items.Add(zForm.CreateToolStripButton("panel 5", (sender, eventArgs) => ActiveTabPanel(4))); toolStrip1.ResumeLayout(false); _toolsPanel.Controls.Add(toolStrip1); }
private void InitializeComponent() { toolStripContainer1 = new ToolStripContainer(); toolStrip1 = new ToolStrip(); toolStripDropDown = new ToolStripDropDownButton(); toolStripContainer1.TopToolStripPanel.SuspendLayout(); toolStripContainer1.SuspendLayout(); toolStrip1.SuspendLayout(); SuspendLayout(); toolStripContainer1.ContentPanel.Size = new Size(813, 237); toolStripContainer1.Dock = DockStyle.Fill; toolStripContainer1.Location = new Point(0, 0); toolStripContainer1.Name = "toolStripContainer1"; toolStripContainer1.Size = new Size(813, 262); toolStripContainer1.TabIndex = 0; toolStripContainer1.Text = "toolStripContainer1"; toolStripContainer1.TopToolStripPanel.Controls.Add(toolStrip1); toolStrip1.Dock = DockStyle.None; toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDown }); toolStrip1.Location = new Point(3, 0); toolStrip1.Name = "toolStrip1"; toolStrip1.Size = new Size(207, 25); toolStrip1.TabIndex = 0; toolStripDropDown.DisplayStyle = ToolStripItemDisplayStyle.Text; toolStripDropDown.ImageTransparentColor = Color.Magenta; toolStripDropDown.Name = "toolStripDropDown"; toolStripDropDown.Size = new Size(164, 22); toolStripDropDown.Text = "toolStripDropDownButton1"; toolStripDropDown.DropDownOpened += toolStripDropDown_DropDownOpened; AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(813, 262); Controls.Add(toolStripContainer1); Name = "Form1"; Text = "Form1"; toolStripContainer1.TopToolStripPanel.ResumeLayout(false); toolStripContainer1.TopToolStripPanel.PerformLayout(); toolStripContainer1.ResumeLayout(false); toolStripContainer1.PerformLayout(); toolStrip1.ResumeLayout(false); toolStrip1.PerformLayout(); ResumeLayout(false); }
private void InitializeComponent() { var resources = new ComponentResourceManager(typeof(ImageButton)); _tsMain = new ToolStrip(); _bButton = new ToolStripButton(); _tsMain.SuspendLayout(); SuspendLayout(); // // tsMain // _tsMain.BackColor = System.Drawing.Color.Transparent; _tsMain.CanOverflow = false; _tsMain.Dock = DockStyle.Fill; _tsMain.GripMargin = new Padding(0); _tsMain.GripStyle = ToolStripGripStyle.Hidden; _tsMain.Items.AddRange(new ToolStripItem[] { _bButton }); _tsMain.Location = new System.Drawing.Point(0, 0); _tsMain.Name = "_tsMain"; _tsMain.Size = new System.Drawing.Size(25, 25); _tsMain.TabIndex = 0; _tsMain.Renderer = new ImageButtonToolStripSystemRenderer(); // // bButton // _bButton.DisplayStyle = ToolStripItemDisplayStyle.Image; _bButton.Image = ((System.Drawing.Image)(resources.GetObject("_bButton.Image"))); _bButton.ImageTransparentColor = System.Drawing.Color.Magenta; _bButton.Name = "_bButton"; _bButton.Size = new System.Drawing.Size(23, 22); _bButton.Click += bButton_Click; _bButton.DoubleClick += bButton_DoubleClick; // // ImageButton // Controls.Add(_tsMain); Name = "ImageButton"; Size = new System.Drawing.Size(25, 25); _tsMain.ResumeLayout(false); _tsMain.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private static void BlockLayout(bool bBlock) { ToolStrip ts = ((g_tsiHost != null) ? g_tsiHost.Owner : null); if (ts == null) { Debug.Assert(false); return; } if (bBlock) { ts.SuspendLayout(); } else { ts.ResumeLayout(); } }
public ToolStrip1() { ToolStrip toolStrip = new ToolStrip(); toolStrip.SuspendLayout(); toolStrip.Dock = DockStyle.Top; var tb = zForm.CreateToolStripTextBox(backColor: SystemColors.Control, width: 100); tb.Enabled = false; toolStrip.Items.Add(tb); toolStrip.Items.Add(zForm.CreateToolStripLabel("tata")); toolStrip.Items.Add(zForm.CreateToolStripLabelSeparator(100)); toolStrip.Items.Add(zForm.CreateToolStripTextBox("toto")); toolStrip.ResumeLayout(false); this.SuspendLayout(); this.ClientSize = new Size(1000, 300); this.Controls.Add(toolStrip); this.ResumeLayout(false); this.PerformLayout(); }
void _InitToolstrip(ToolStrip ts) { this.HasToolbar = true; ts.SuspendLayout(); ts.AutoSize = false; ts.Stretch = false; ts.GripStyle = ToolStripGripStyle.Hidden; ts.CanOverflow = true; if (ts is MenuStrip) { foreach (ToolStripItem v in ts.Items) { v.Overflow = ToolStripItemOverflow.AsNeeded; } } ts.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow; _minHeight = ts.PreferredSize.Height; _minWidth = _minHeight - 1; ts.ResumeLayout(false); }
void MakeNewToolStipButtons() { MakeSelectArray(); Bitmap[] pics = getFoorOneTiles(); blockImages = pics; ToolStripButton[] b = new ToolStripButton[selectArray.Length]; toolStrip.SuspendLayout(); b[0] = new ToolStripButton(); b[0].DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; b[0].Image = global::Redstone_Simulator.Properties.Resources.Play24; b[0].Name = "StartClock"; b[0].Size = new System.Drawing.Size(23, 29); b[0].Text = "Start Clock"; b[0].Click += new System.EventHandler(this.startRunning); toolStrip.Items.Add(b[0]); toolStrip.Items.Add(new ToolStripSeparator()); selectedButton = new ToolStripButton(pics[0]); toolStrip.Items.Add(selectedButton); toolStrip.Items.Add(new ToolStripSeparator()); for (int i = 0; i < b.Length; i++) { b[i] = new ToolStripButton(); b[i].AutoSize = true; b[i].DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; b[i].Image = pics[i]; b[i].Name = "BlockSelect_" + i; b[i].Size = pics[i].Size; b[i].Text = "BlockSelect_" + i; b[i].Tag = i; b[i].Click += new System.EventHandler(delegate(object o, EventArgs e) { SelectBlock((int)((ToolStripButton)o).Tag); }); } toolStrip.Items.AddRange(b); b[0].Select(); toolStrip.ResumeLayout(false); }
protected virtual void CreateToolStrip() { var GenericToolName = new ToolStripLabel(); _toolStrip = new ToolStrip(); _toolStrip.SuspendLayout(); GenericToolName.BackColor = SystemColors.ControlDark; GenericToolName.Font = new Font("Segoe UI", 9F, FontStyle.Bold); GenericToolName.Image = this.ToolBoxImage; GenericToolName.Name = "GenericToolName"; GenericToolName.Size = new Size(93, 22); GenericToolName.Text = this.Name; _toolStrip.GripStyle = ToolStripGripStyle.Hidden; _toolStrip.Items.AddRange(new ToolStripItem[] { GenericToolName }); _toolStrip.Name = "Generic_ToolStrip"; _toolStrip.ResumeLayout(false); _toolStrip.PerformLayout(); }
private void InitializeComponent() { this.nextBtn = new ToolStripButton(); this.prevBtn = new ToolStripButton(); this.helpBtn = new ToolStripButton(); this.sourceText = new RichTextBox(); this.commentText = new Label(); this.topPanel = new Panel(); toolStrip = new ToolStrip(); toolStrip.SuspendLayout(); this.SuspendLayout(); toolStrip.Items.AddRange(new ToolStripItem[] { this.helpBtn, this.prevBtn, this.nextBtn }); toolStrip.Anchor = System.Windows.Forms.AnchorStyles.Right; toolStrip.BackColor = System.Drawing.SystemColors.Info; toolStrip.Dock = System.Windows.Forms.DockStyle.None; toolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; toolStrip.Location = new System.Drawing.Point(501, 9); toolStrip.Size = new System.Drawing.Size(70, 23); toolStrip.Location = new System.Drawing.Point(0, 0); toolStrip.Name = "toolStrip1"; toolStrip.TabIndex = 1; toolStrip.Text = "toolStrip1"; // // startCollectingDataBtn // this.helpBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.helpBtn.Image = MSFast.GUI.Engine.Resources.Resources.help; this.helpBtn.ImageTransparentColor = System.Drawing.Color.Magenta; this.helpBtn.Name = "helpBtn"; this.helpBtn.Size = new System.Drawing.Size(23, 22); this.helpBtn.Text = "More Details"; this.helpBtn.Alignment = ToolStripItemAlignment.Left; // // startCollectingDataBtn // this.nextBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.nextBtn.Image = MSFast.GUI.Engine.Resources.Resources.next; this.nextBtn.ImageTransparentColor = System.Drawing.Color.Magenta; this.nextBtn.Name = "nextBtn"; this.nextBtn.Size = new System.Drawing.Size(23, 22); this.nextBtn.Text = "Next Occurance"; this.nextBtn.Alignment = ToolStripItemAlignment.Left; // // startCollectingDataBtn // this.prevBtn.DisplayStyle = ToolStripItemDisplayStyle.Image; this.prevBtn.Image = MSFast.GUI.Engine.Resources.Resources.prev; this.prevBtn.ImageTransparentColor = System.Drawing.Color.Magenta; this.prevBtn.Name = "prevBtn"; this.prevBtn.Size = new System.Drawing.Size(23, 22); this.prevBtn.Text = "Previous Occurance"; this.prevBtn.Alignment = ToolStripItemAlignment.Left; // // startCollectingDataBtn // this.commentText.Name = "commentText"; this.commentText.Text = ""; this.commentText.Visible = false; this.commentText.Height = 58; this.commentText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.commentText.BackColor = System.Drawing.SystemColors.Info; this.commentText.Padding = new Padding(5, 5, 5, 5); // // sourceText // this.sourceText.Location = new System.Drawing.Point(66, 92); this.sourceText.Name = "sourceText"; this.sourceText.Size = new System.Drawing.Size(100, 96); this.sourceText.TabIndex = 1; this.sourceText.Text = ""; this.sourceText.ReadOnly = true; this.sourceText.BackColor = Color.White; this.sourceText.WordWrap = false; this.topPanel.BackColor = System.Drawing.SystemColors.Info; this.topPanel.Visible = true; this.topPanel.SuspendLayout(); this.topPanel.Size = new System.Drawing.Size(479, 50); this.topPanel.Controls.Add(this.commentText); this.topPanel.Controls.Add(this.toolStrip); this.Controls.Add(this.sourceText); this.Controls.Add(this.topPanel); topPanel.ResumeLayout(false); topPanel.PerformLayout(); toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); this.nextBtn.Click += new EventHandler(nextBtn_Click); this.prevBtn.Click += new EventHandler(prevBtn_Click); this.helpBtn.Click += new EventHandler(helpBtn_Click); }
private void InitializeComponent() { var resources = new System.ComponentModel.ComponentResourceManager(typeof(FolderForm)); ToolStrip1 = new ToolStrip(); ToolStripButton1 = new ToolStripButton(); ToolStripButton2 = new ToolStripButton(); ToolStripButton3 = new ToolStripButton(); ToolStripButton4 = new ToolStripButton(); ToolStripButton5 = new ToolStripButton(); ToolStripButton6 = new ToolStripButton(); ToolStripButton7 = new ToolStripButton(); ToolStripButton8 = new ToolStripButton(); ToolStripButton9 = new ToolStripButton(); ToolStripButton10 = new ToolStripButton(); ToolStripButton11 = new ToolStripButton(); ToolStripButton12 = new ToolStripButton(); ToolStripButton13 = new ToolStripButton(); ToolStripButton14 = new ToolStripButton(); ToolStripButton15 = new ToolStripButton(); ToolStrip1.SuspendLayout(); SuspendLayout(); // // ToolStrip1 // ToolStrip1.Items.AddRange(new ToolStripItem[] { ToolStripButton1, ToolStripButton2, ToolStripButton3, ToolStripButton4, ToolStripButton5, ToolStripButton6, ToolStripButton7, ToolStripButton8, ToolStripButton9, ToolStripButton10, ToolStripButton11, ToolStripButton12, ToolStripButton13, ToolStripButton14, ToolStripButton15 }); ToolStrip1.Location = new Point(0, 0); ToolStrip1.Name = "ToolStrip1"; ToolStrip1.Size = new Size(621, 25); ToolStrip1.TabIndex = 0; ToolStrip1.Text = "ToolStrip1"; // // ToolStripButton1 // ToolStripButton1.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton1.Image = My.Resources.Resources.test; ToolStripButton1.ImageTransparentColor = Color.Magenta; ToolStripButton1.Name = "ToolStripButton1"; ToolStripButton1.Size = new Size(23, 22); ToolStripButton1.Text = "ToolStripButton1"; // // ToolStripButton2 // ToolStripButton2.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton2.Image = My.Resources.Resources.test2; ToolStripButton2.ImageTransparentColor = Color.Magenta; ToolStripButton2.Name = "ToolStripButton2"; ToolStripButton2.Size = new Size(23, 22); ToolStripButton2.Text = "ToolStripButton2"; // // ToolStripButton3 // ToolStripButton3.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton3.Image = My.Resources.Resources.test3; ToolStripButton3.ImageTransparentColor = Color.Magenta; ToolStripButton3.Name = "ToolStripButton3"; ToolStripButton3.Size = new Size(23, 22); ToolStripButton3.Text = "ToolStripButton3"; // // ToolStripButton4 // ToolStripButton4.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton4.Image = My.Resources.Resource1.test; ToolStripButton4.ImageTransparentColor = Color.Magenta; ToolStripButton4.Name = "ToolStripButton4"; ToolStripButton4.Size = new Size(23, 22); ToolStripButton4.Text = "ToolStripButton4"; // // ToolStripButton5 // ToolStripButton5.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton5.Image = My.Resources.Resource1.test2; ToolStripButton5.ImageTransparentColor = Color.Magenta; ToolStripButton5.Name = "ToolStripButton5"; ToolStripButton5.Size = new Size(23, 22); ToolStripButton5.Text = "ToolStripButton5"; // // ToolStripButton6 // ToolStripButton6.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton6.Image = My.Resources.Resource1.test3; ToolStripButton6.ImageTransparentColor = Color.Magenta; ToolStripButton6.Name = "ToolStripButton6"; ToolStripButton6.Size = new Size(23, 22); ToolStripButton6.Text = "ToolStripButton6"; // // ToolStripButton7 // ToolStripButton7.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton7.Image = (Image)resources.GetObject("ToolStripButton7.Image"); ToolStripButton7.ImageTransparentColor = Color.Magenta; ToolStripButton7.Name = "ToolStripButton7"; ToolStripButton7.Size = new Size(23, 22); ToolStripButton7.Text = "ToolStripButton7"; // // ToolStripButton8 // ToolStripButton8.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton8.Image = (Image)resources.GetObject("ToolStripButton8.Image"); ToolStripButton8.ImageTransparentColor = Color.Magenta; ToolStripButton8.Name = "ToolStripButton8"; ToolStripButton8.Size = new Size(23, 22); ToolStripButton8.Text = "ToolStripButton8"; // // ToolStripButton9 // ToolStripButton9.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton9.Image = (Image)resources.GetObject("ToolStripButton9.Image"); ToolStripButton9.ImageTransparentColor = Color.Magenta; ToolStripButton9.Name = "ToolStripButton9"; ToolStripButton9.Size = new Size(23, 22); ToolStripButton9.Text = "ToolStripButton9"; // // ToolStripButton10 // ToolStripButton10.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton10.Image = (Image)resources.GetObject("ToolStripButton10.Image"); ToolStripButton10.ImageTransparentColor = Color.Magenta; ToolStripButton10.Name = "ToolStripButton10"; ToolStripButton10.Size = new Size(23, 22); ToolStripButton10.Text = "ToolStripButton10"; // // ToolStripButton11 // ToolStripButton11.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton11.Image = (Image)resources.GetObject("ToolStripButton11.Image"); ToolStripButton11.ImageTransparentColor = Color.Magenta; ToolStripButton11.Name = "ToolStripButton11"; ToolStripButton11.Size = new Size(23, 22); ToolStripButton11.Text = "ToolStripButton11"; // // ToolStripButton12 // ToolStripButton12.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton12.Image = (Image)resources.GetObject("ToolStripButton12.Image"); ToolStripButton12.ImageTransparentColor = Color.Magenta; ToolStripButton12.Name = "ToolStripButton12"; ToolStripButton12.Size = new Size(23, 22); ToolStripButton12.Text = "ToolStripButton12"; // // ToolStripButton13 // ToolStripButton13.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton13.Image = (Image)resources.GetObject("ToolStripButton13.Image"); ToolStripButton13.ImageTransparentColor = Color.Magenta; ToolStripButton13.Name = "ToolStripButton13"; ToolStripButton13.Size = new Size(23, 22); ToolStripButton13.Text = "ToolStripButton13"; // // ToolStripButton14 // ToolStripButton14.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton14.Image = (Image)resources.GetObject("ToolStripButton14.Image"); ToolStripButton14.ImageTransparentColor = Color.Magenta; ToolStripButton14.Name = "ToolStripButton14"; ToolStripButton14.Size = new Size(23, 22); ToolStripButton14.Text = "ToolStripButton14"; // // ToolStripButton15 // ToolStripButton15.DisplayStyle = ToolStripItemDisplayStyle.Image; ToolStripButton15.Image = (Image)resources.GetObject("ToolStripButton15.Image"); ToolStripButton15.ImageTransparentColor = Color.Magenta; ToolStripButton15.Name = "ToolStripButton15"; ToolStripButton15.Size = new Size(23, 22); ToolStripButton15.Text = "ToolStripButton15"; // // FolderForm // AutoScaleDimensions = new SizeF(6.0F, 13.0F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(621, 257); Controls.Add(ToolStrip1); Name = "FolderForm"; Text = "DesignTime images: 123123 then 9 blank, Runtime: 123123123123111 - check tooltips" + ""; ToolStrip1.ResumeLayout(false); ToolStrip1.PerformLayout(); Load += new EventHandler(FolderForm_Load); ResumeLayout(false); PerformLayout(); }
private void InitializeUserReport() { //create a toolbar and user Report types userReportMenu = new ToolStrip(); userReportMenu.SuspendLayout(); SuspendLayout(); userReportMenu.Location = new Point(0, 62);//toolStrip.Location.Y + toolStrip.Size.Height); // new System.Drawing.Point(0, 61); userReportMenu.Size = new Size(1016, 29); userReportMenu.Name = "userReportMenu"; userReportMenu.TabIndex = 2; userReportMenu.Text = "userReportMenu"; userReportMenu.GripStyle = ToolStripGripStyle.Hidden; ToolStripButton tempToolStripButton; int separatorCounter = mUserReports.ReportTypes.Count; //add all user types toolstripbuttons foreach (KeyValuePair <int, UserReportType> userType in mUserReports.ReportTypes) { tempToolStripButton = new ToolStripButton { DisplayStyle = ToolStripItemDisplayStyle.Text, Font = new Font("Trebuchet MS", 12F, FontStyle.Bold, GraphicsUnit.Point, 0), ImageTransparentColor = Color.ForestGreen, Name = "button1", Text = userType.Value.UserReportTypeName, Tag = userType.Value.UserReportTypeID }; tempToolStripButton.Click += TempToolStripButtonClick; userReportMenu.Items.Add(tempToolStripButton); separatorCounter--; if (separatorCounter > 0) { ToolStripSeparator tempSeparator = new ToolStripSeparator(); userReportMenu.Items.Add(tempSeparator); } } //reorder it as backword Control[] myControls = new Control[Controls.Count]; int iCounter = 0, controlCount = Controls.Count; for (int iControl = 0; iControl < controlCount; iControl++) { if (Controls[0].Name != "userReportMenu") //we only add this once { myControls[iCounter++] = Controls[0]; } Controls.RemoveAt(0); } Controls.Add(userReportMenu); //add it back for (int iControl = 0; iControl < myControls.Length; iControl++) { Controls.Add(myControls[iControl]); } userReportMenu.ResumeLayout(false); userReportMenu.PerformLayout(); ResumeLayout(true); PerformLayout(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { _Components = new System.ComponentModel.Container(); _TopLayoutPanel = new System.Windows.Forms.Panel(); _ToolStrip = new System.Windows.Forms.ToolStrip(); _NewTaskSplitButton = new System.Windows.Forms.ToolStripSplitButton(); _NewTaskMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _NewFolderMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _SortBySplitButton = new System.Windows.Forms.ToolStripSplitButton(); _PriorityMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _CompletedMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _DescriptionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); _SplitContainer = new System.Windows.Forms.SplitContainer(); _TaskTreeView = new Genetibase.NuGenTaskList.NuGenTaskTreeView(); _TaskEditBox = new Genetibase.NuGenTaskList.NuGenTaskEditBox(); _TopLayoutPanel.SuspendLayout(); _ToolStrip.SuspendLayout(); _SplitContainer.Panel1.SuspendLayout(); _SplitContainer.Panel2.SuspendLayout(); _SplitContainer.SuspendLayout(); this.SuspendLayout(); // // topLayoutPanel // _TopLayoutPanel.Controls.Add(_ToolStrip); _TopLayoutPanel.Dock = System.Windows.Forms.DockStyle.Top; _TopLayoutPanel.Location = new System.Drawing.Point(0, 0); _TopLayoutPanel.Name = "topLayoutPanel"; _TopLayoutPanel.Size = new System.Drawing.Size(265, 27); _TopLayoutPanel.TabIndex = 0; // // toolStrip // _ToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; _ToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { _NewTaskSplitButton, _SortBySplitButton }); _ToolStrip.Location = new System.Drawing.Point(0, 0); _ToolStrip.Name = "toolStrip"; _ToolStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; _ToolStrip.Size = new System.Drawing.Size(265, 25); _ToolStrip.TabIndex = 0; _ToolStrip.Text = "toolStrip1"; // // newTaskSplitButton // _NewTaskSplitButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { _NewTaskMenuItem, _NewFolderMenuItem }); _NewTaskSplitButton.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Create_New; _NewTaskSplitButton.ImageTransparentColor = System.Drawing.Color.Magenta; _NewTaskSplitButton.Name = "newTaskSplitButton"; _NewTaskSplitButton.Size = new System.Drawing.Size(85, 22); _NewTaskSplitButton.Text = "New &Task"; _NewTaskSplitButton.ButtonClick += new System.EventHandler(_NewTaskMenuItem_Click); // // newTaskMenuItem // _NewTaskMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Create_New; _NewTaskMenuItem.Name = "newTaskMenuItem"; _NewTaskMenuItem.Size = new System.Drawing.Size(139, 22); _NewTaskMenuItem.Text = "New &Task"; _NewTaskMenuItem.Click += new System.EventHandler(_NewTaskMenuItem_Click); // // newFolderMenuItem // _NewFolderMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Create_New_Folder; _NewFolderMenuItem.Name = "newFolderMenuItem"; _NewFolderMenuItem.Size = new System.Drawing.Size(139, 22); _NewFolderMenuItem.Text = "New &Folder"; _NewFolderMenuItem.Click += new System.EventHandler(_NewFolderMenuItem_Click); // // sortBySplitButton // _SortBySplitButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { _PriorityMenuItem, _CompletedMenuItem, _DescriptionMenuItem }); _SortBySplitButton.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_AZ; _SortBySplitButton.ImageTransparentColor = System.Drawing.Color.White; _SortBySplitButton.Name = "sortBySplitButton"; _SortBySplitButton.Size = new System.Drawing.Size(74, 22); _SortBySplitButton.Text = "&Sort By"; // // priorityMenuItem // _PriorityMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_Priority; _PriorityMenuItem.Name = "priorityMenuItem"; _PriorityMenuItem.Size = new System.Drawing.Size(152, 22); _PriorityMenuItem.Text = "&Priority"; _PriorityMenuItem.Click += new System.EventHandler(_PriorityMenuItem_Click); // // completedMenuItem // _CompletedMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_Completed; _CompletedMenuItem.Name = "completedMenuItem"; _CompletedMenuItem.Size = new System.Drawing.Size(152, 22); _CompletedMenuItem.Text = "&Completed"; _CompletedMenuItem.Click += new System.EventHandler(_CompletedMenuItem_Click); // // descriptionMenuItem // _DescriptionMenuItem.Image = global::Genetibase.NuGenTaskList.Properties.Resources.Sort_Description; _DescriptionMenuItem.Name = "descriptionMenuItem"; _DescriptionMenuItem.Size = new System.Drawing.Size(152, 22); _DescriptionMenuItem.Text = "&Description"; _DescriptionMenuItem.Click += new System.EventHandler(_DescriptionMenuItem_Click); // // splitContainer // _SplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; _SplitContainer.Location = new System.Drawing.Point(0, 27); _SplitContainer.Name = "splitContainer"; _SplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer.Panel1 // _SplitContainer.Panel1.Controls.Add(_TaskTreeView); // // splitContainer.Panel2 // _SplitContainer.Panel2.Controls.Add(_TaskEditBox); _SplitContainer.Size = new System.Drawing.Size(265, 373); _SplitContainer.SplitterDistance = 260; _SplitContainer.TabIndex = 1; // // taskTreeView // _TaskTreeView.AllowDrop = true; _TaskTreeView.CheckBoxes = true; _TaskTreeView.Dock = System.Windows.Forms.DockStyle.Fill; _TaskTreeView.HideSelection = false; _TaskTreeView.ImageIndex = 0; _TaskTreeView.Location = new System.Drawing.Point(0, 0); _TaskTreeView.Name = "taskTreeView"; _TaskTreeView.SelectedImageIndex = 0; _TaskTreeView.ShowLines = false; _TaskTreeView.Size = new System.Drawing.Size(265, 165); _TaskTreeView.TabIndex = 0; // // taskEditBox // _TaskEditBox.BackColor = System.Drawing.SystemColors.Window; _TaskEditBox.Dock = System.Windows.Forms.DockStyle.Fill; _TaskEditBox.Enabled = false; _TaskEditBox.Location = new System.Drawing.Point(0, 0); _TaskEditBox.Multiline = true; _TaskEditBox.Name = "taskEditBox"; _TaskEditBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; _TaskEditBox.Size = new System.Drawing.Size(265, 204); _TaskEditBox.TabIndex = 0; // // NuGenTaskListUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(_SplitContainer); this.Controls.Add(_TopLayoutPanel); this.Name = "NuGenTaskListUI"; this.Size = new System.Drawing.Size(265, 400); _TopLayoutPanel.ResumeLayout(false); _TopLayoutPanel.PerformLayout(); _ToolStrip.ResumeLayout(false); _ToolStrip.PerformLayout(); _SplitContainer.Panel1.ResumeLayout(false); _SplitContainer.Panel2.ResumeLayout(false); _SplitContainer.Panel2.PerformLayout(); _SplitContainer.ResumeLayout(false); this.ResumeLayout(false); }
private void InitializeComponent() { Text = "Graphite"; ClientSize = new Size (640, 480); _toolStrip = new ToolStrip(); _toolStrip.SuspendLayout (); SuspendLayout (); var g = CreateCommandGroups (); CreateToolbarButtons (g); CreateShapeSelector (); CreateMenu (g); CreateScene (); Controls.Add (_toolStrip); Controls.Add (_scene); Controls.Add (_menuStrip); _toolStrip.ResumeLayout (false); ResumeLayout (false); PerformLayout (); }
/// <summary> /// 设置ToolBar /// </summary> /// <param name="tb1"></param> /// <param name="tb2"></param> /// <param name="al1"></param> /// <param name="al2"></param> public static void ChangeButton(ToolStrip tb1, ToolStrip tb2, ArrayList al1, ArrayList al2) { if (al1.Count == 0 && al2.Count == 0) { return; } tb1.SuspendLayout(); tb2.SuspendLayout(); ArrayList tbAll = new ArrayList(); foreach (ToolStripItem tb in tb1.Items) { tbAll.Add(tb); } foreach (ToolStripItem tb in tb2.Items) { tbAll.Add(tb); } tb1.Items.Clear(); tb2.Items.Clear(); foreach (string text in al1) { if (text.Trim() == "-") { ToolStripSeparator tb = new ToolStripSeparator(); tb1.Items.Add(tb); } else { foreach (ToolStripItem tb in tbAll) { if (tb.Text.Trim() == text.Trim()) { SetButtonProperty(tb); tb1.Items.Add(tb); break; } } } } foreach (string text in al2) { if (text.Trim() == "-") { ToolStripSeparator tb = new ToolStripSeparator(); tb2.Items.Add(tb); } else { foreach (ToolStripItem tb in tbAll) { if (tb.Text.Trim() == text.Trim()) { SetButtonProperty(tb); tb2.Items.Add(tb); break; } } } } tb1.ResumeLayout(true); tb2.ResumeLayout(true); }
private void GenerateToolbar(ToolStrip rootToolStrip, List <ToolBarItem> toolsBarItem, List <ActionVerb> actions) { rootToolStrip.SuspendLayout(); foreach (var item in toolsBarItem) { if (item.Group.Count > 1) { bool toolAvaialble = false; var splitButton = new ToolStripSplitButton(); splitButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; splitButton.Image = Image.FromFile(string.Format(@"{0}\Resource\{1}.png", RuntimeInfo.Inst.LaunchEnvExeDir, item.Name)); splitButton.Name = string.Format("{0}_toolStripBttn{1}", rootToolStrip.Name, item.Name); splitButton.Text = item.Name; splitButton.Tag = item.Name; splitButton.MouseDown += StripButton_MouseDown; foreach (var splitItem in item.Group) { //if dynamic path tool then don't check the file path if (string.IsNullOrWhiteSpace(splitItem.Path) || File.Exists(splitItem.Path)) { toolAvaialble = true; var toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem.Image = Image.FromFile(string.Format(@"{0}\Resource\{1}.png", RuntimeInfo.Inst.LaunchEnvExeDir, splitItem.Name)); toolStripMenuItem.Name = string.Format("{0}_toolStripBttn{1}_{2}", rootToolStrip.Name, item.Name, splitItem.Name); toolStripMenuItem.Text = splitItem.Name; toolStripMenuItem.Tag = splitItem.Name; toolStripMenuItem.Click += EditorsToolStripMenuItem_Click; if (RuntimeInfo.Inst.ShowRunAsForAll) { var retMenu = GUIUtility.GenerateActionMenus(toolStripMenuItem.Name, toolStripMenuItem.Tag as string, actions, EditorsToolStripActionMenuItem_Click); if (retMenu.Length > 0) { toolStripMenuItem.DropDownItems.AddRange(retMenu); } } splitButton.DropDownItems.Add(toolStripMenuItem); } } if (toolAvaialble) { rootToolStrip.Items.Add(splitButton); _toolStripItem.Add(splitButton); } } else { var splitItem = item.Group.FirstOrDefault(); if (splitItem != null) { //if dynamic path tool then don't check the file path if (string.IsNullOrWhiteSpace(splitItem.Path) || File.Exists(splitItem.Path)) { ToolStripItem stripButton = new ToolStripButton(); stripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; stripButton.Image = Image.FromFile(string.Format(@"{0}\Resource\{1}.png", RuntimeInfo.Inst.LaunchEnvExeDir, splitItem.Name)); stripButton.Name = string.Format("{0}_toolStripBttn{1}", rootToolStrip.Name, splitItem.Name); stripButton.Text = splitItem.Name; stripButton.Tag = splitItem.Name; stripButton.MouseDown += StripButton_MouseDown; rootToolStrip.Items.Add(stripButton); } } } } rootToolStrip.ResumeLayout(false); rootToolStrip.PerformLayout(); }
/// <summary> /// 设置ToolBar /// </summary> /// <param name="tb1"></param> /// <param name="tb2"></param> /// <param name="al1"></param> /// <param name="al2"></param> public static void ChangeButton(ToolStrip tb1, ToolStrip tb2, ArrayList al1, ArrayList al2) { if (al1.Count == 0 && al2.Count == 0) { return; } tb1.SuspendLayout(); tb2.SuspendLayout(); ArrayList tbAll = new ArrayList(); foreach (ToolStripItem tb in tb1.Items) { tbAll.Add(tb); } foreach (ToolStripItem tb in tb2.Items) { tbAll.Add(tb); } tb1.Items.Clear(); tb2.Items.Clear(); int index = 0; string tempText = string.Empty; string textValue = string.Empty; foreach (string text in al1) { if (text.Trim() == "-") { ToolStripSeparator tb = new ToolStripSeparator(); tb1.Items.Add(tb); } else { foreach (ToolStripItem tb in tbAll) { //快捷键 //{1B10BCB7-8133-4282-8479-9C41FE5A23FD} 区域语言转换 string shortKeyStr = string.Empty; index = text.Trim().IndexOf('('); if (index > 0) { tempText = text.Trim().Substring(0, index); shortKeyStr = text.Trim().Substring(index); } else { tempText = text.Trim(); } //{1B10BCB7-8133-4282-8479-9C41FE5A23FD} 区域语言转换 tempText = Neusoft.FrameWork.Management.Language.Msg(tempText); textValue = tb.Text.Trim(); index = textValue.IndexOf('('); if (index > 0) { textValue = textValue.Substring(0, index); } //{1B10BCB7-8133-4282-8479-9C41FE5A23FD} 区域语言转换 textValue = Neusoft.FrameWork.Management.Language.Msg(textValue); //if (tb.Text.Trim() == tempText.Trim()) if (textValue == tempText.Trim()) { tb.Text = text.Trim(); //{1B10BCB7-8133-4282-8479-9C41FE5A23FD} 区域语言转换 if (translateTextDictionary.ContainsKey(textValue) == false) //不包含该文本 { translateTextDictionary.Add(textValue, text.Trim()); //Key 区域语言文本 Value 原始文本 } tb.Text = textValue + shortKeyStr; //{1B10BCB7-8133-4282-8479-9C41FE5A23FD} 区域语言转换 SetButtonProperty(tb); tb1.Items.Add(tb); break; } } } } foreach (string text in al2) { if (text.Trim() == "-") { ToolStripSeparator tb = new ToolStripSeparator(); tb2.Items.Add(tb); } else { foreach (ToolStripItem tb in tbAll) { if (tb.Text.Trim() == text.Trim()) { SetButtonProperty(tb); tb2.Items.Add(tb); break; } } } } tb1.ResumeLayout(true); tb2.ResumeLayout(true); }