本文整理汇总了C#中System.Windows.Forms.ToolStripDropDownButton类的典型用法代码示例。如果您正苦于以下问题:C# ToolStripDropDownButton类的具体用法?C# ToolStripDropDownButton怎么用?C# ToolStripDropDownButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolStripDropDownButton类属于System.Windows.Forms命名空间,在下文中一共展示了ToolStripDropDownButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateButton
public ToolStripItem CreateButton()
{
ToolStripDropDownButton menu = new ToolStripDropDownButton (Label);
foreach (IUserInterfaceItem item in ChildNodes)
menu.DropDownItems.Add (item.CreateMenuItem ());
return menu;
}
开发者ID:wanglehui,项目名称:mono-addins,代码行数:7,代码来源:MenuExtensionNode.cs
示例2: EditorToolStrip
public EditorToolStrip()
{
var dropDown = new ToolStripDropDownButton();
dropDown.Text = "Style";
dropDown.Alignment = ToolStripItemAlignment.Right;
dropDown.DropDownItems.Add("Default");
dropDown.DropDownItems.Add("GitHub");
var items = new ToolStripItem[] {
dropDown,
new ToolStripMenuItem("Some Button")
};
this._dataSourceMock = new Mock<IEditorToolStripDataSource>();
this._dataSourceMock.Setup(m => m.NumberOfEditorToolStripItems(It.IsAny<Model.EditorToolStrip>()))
.Returns(items.Length)
.Verifiable();
this._dataSourceMock.Setup(m => m.EditorToolStripItemForIndex(It.IsAny<Model.EditorToolStrip>(), It.IsAny<int>()))
.Returns<Model.EditorToolStrip, int>((inst, index) =>
{
return items[index];
})
.Verifiable();
this._subject = new Model.EditorToolStrip(this._dataSourceMock.Object, null);
}
开发者ID:pseudomuto,项目名称:muto-mark,代码行数:27,代码来源:EditorToolStrip.cs
示例3: InitMainMenu
public void InitMainMenu()
{
ToolStripDropDownButton tsddbFile = new ToolStripDropDownButton("操作(&F)");
this.menuBar.Items.Add(tsddbFile);
tsmiNew = new ToolStripMenuItem("新窗口(&N)");
tsddbFile.DropDownItems.Add(tsmiNew);
tsmiNew.Click += new EventHandler(tsmiNew_Click);
tsmiClose = new ToolStripMenuItem("关闭(&E)");
tsddbFile.DropDownItems.Add(tsmiClose);
tsmiClose.Click += new EventHandler(tsmiClose_Click);
ToolStripDropDownButton tsddbGragh = new ToolStripDropDownButton("趋势图(&G)");
this.menuBar.Items.Add(tsddbGragh);
tsmiDayLine = new ToolStripMenuItem("日K线(&D)");
tsddbGragh.DropDownItems.Add(tsmiDayLine);
tsmiDayLine.Click += new EventHandler(tsmiToDayLine);
tsmiFiveMinsLine = new ToolStripMenuItem("5分钟线(&M)");
tsddbGragh.DropDownItems.Add(tsmiFiveMinsLine);
tsmiFiveMinsLine.Click += new EventHandler(tsmiToFiveMinsLine);
ToolStripDropDownButton tsddbTools = new ToolStripDropDownButton("工具(&T)");
this.menuBar.Items.Add(tsddbTools);
tsmiFormulaEditor = new ToolStripMenuItem("公式编辑器(&D)");
tsddbTools.DropDownItems.Add(tsmiFormulaEditor);
tsmiFormulaEditor.Click += new EventHandler(tsmiOpenFormulaEditor);
}
开发者ID:inksmallfrog,项目名称:CSStock,代码行数:26,代码来源:StockForm.cs
示例4: ToolStripDropDownButtonPresentation
/// <summary>
/// Initializes a new instance of the 'ToolStripDropDownButtonPresentation' class.
/// </summary>
/// <param name="toolStripDropDownButton">ToolStripDropDownButton control.</param>
public ToolStripDropDownButtonPresentation(ToolStripDropDownButton toolStripDropDownButton)
{
mToolStripDropDownButton = toolStripDropDownButton;
if (mToolStripDropDownButton != null)
{
mToolStripDropDownButton.Click += new System.EventHandler(HandleDropDownButtonClick);
}
}
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:12,代码来源:ToolStripDropDownButtonPresentation.cs
示例5: CreateStatusBarItem
protected override void CreateStatusBarItem()
{
var tempStatusBarItem = new ToolStripDropDownButton();
tempStatusBarItem.Text = _serialPort.Baud.ToString();
foreach (var baudRate in BaudRates)
tempStatusBarItem.DropDownItems.Add(baudRate.ToString());
tempStatusBarItem.DropDownItemClicked += (sender, args) => SetBaudTo(args.ClickedItem.Text);
_statusBarItem = tempStatusBarItem;
}
开发者ID:RJefferys,项目名称:Hypertoken,代码行数:10,代码来源:SerialStatusbarGUI.cs
示例6: TTSFormManager
public TTSFormManager(System.Windows.Forms.Form mdiparent, System.Windows.Forms.ToolStripDropDownButton workspacedropdown, System.Windows.Forms.ToolStripDropDownButton windowdropdown)
{
this.MDIParent = mdiparent;
this.WorkspaceDropDown = workspacedropdown;
this.WindowDropDown = windowdropdown;
this.ClearWindows();
this.ClearWorkspace();
this.AddWorkspace(this.CurrentWorkspace, true);
this.WindowDropDown.Text = "Windows (0)";
}
开发者ID:jinpan,项目名称:Traders_IAP,代码行数:10,代码来源:TTSFormManager.cs
示例7: InitializeComponent
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(PropertyVersionFilterControl));
this.tsTop = new ToolStrip();
this.tslField = new ToolStripLabel();
this.tslPropertyName = new ToolStripLabel();
this.tslIs = new ToolStripLabel();
this.tsddValueOperation = new ToolStripDropDownButton();
this.tsmiOperationEquals = new ToolStripMenuItem();
this.tsmiOperationNotEquals = new ToolStripMenuItem();
this.tsmiOperationSmaller = new ToolStripMenuItem();
this.tsmiOperationLarger = new ToolStripMenuItem();
this.tstbValue = new ToolStripTextBox();
this.tsTop.SuspendLayout();
base.SuspendLayout();
this.tsTop.BackColor = Color.Transparent;
manager.ApplyResources(this.tsTop, "tsTop");
this.tsTop.GripStyle = ToolStripGripStyle.Hidden;
this.tsTop.Items.AddRange(new ToolStripItem[] { this.tslField, this.tslPropertyName, this.tslIs, this.tsddValueOperation, this.tstbValue });
this.tsTop.Name = "tsTop";
this.tslField.Name = "tslField";
manager.ApplyResources(this.tslField, "tslField");
this.tslPropertyName.Name = "tslPropertyName";
manager.ApplyResources(this.tslPropertyName, "tslPropertyName");
this.tslIs.Name = "tslIs";
manager.ApplyResources(this.tslIs, "tslIs");
this.tsddValueOperation.DisplayStyle = ToolStripItemDisplayStyle.Text;
this.tsddValueOperation.DropDownItems.AddRange(new ToolStripItem[] { this.tsmiOperationEquals, this.tsmiOperationNotEquals, this.tsmiOperationSmaller, this.tsmiOperationLarger });
this.tsddValueOperation.Name = "tsddValueOperation";
manager.ApplyResources(this.tsddValueOperation, "tsddValueOperation");
this.tsmiOperationEquals.Name = "tsmiOperationEquals";
manager.ApplyResources(this.tsmiOperationEquals, "tsmiOperationEquals");
this.tsmiOperationEquals.Click += new EventHandler(this.tsmiOperationEquals_Click);
this.tsmiOperationNotEquals.Name = "tsmiOperationNotEquals";
manager.ApplyResources(this.tsmiOperationNotEquals, "tsmiOperationNotEquals");
this.tsmiOperationNotEquals.Click += new EventHandler(this.tsmiOperationEquals_Click);
this.tsmiOperationSmaller.Name = "tsmiOperationSmaller";
manager.ApplyResources(this.tsmiOperationSmaller, "tsmiOperationSmaller");
this.tsmiOperationSmaller.Click += new EventHandler(this.tsmiOperationEquals_Click);
this.tsmiOperationLarger.Name = "tsmiOperationLarger";
manager.ApplyResources(this.tsmiOperationLarger, "tsmiOperationLarger");
this.tsmiOperationLarger.Click += new EventHandler(this.tsmiOperationEquals_Click);
this.tstbValue.BorderStyle = BorderStyle.FixedSingle;
manager.ApplyResources(this.tstbValue, "tstbValue");
this.tstbValue.Name = "tstbValue";
this.tstbValue.TextChanged += new EventHandler(this.tstbValue_TextChanged);
manager.ApplyResources(this, "$this");
base.AutoScaleMode = AutoScaleMode.Font;
base.Controls.Add(this.tsTop);
base.Name = "PropertyVersionFilterControl";
this.tsTop.ResumeLayout(false);
this.tsTop.PerformLayout();
base.ResumeLayout(false);
base.PerformLayout();
}
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:55,代码来源:PropertyVersionFilterControl.cs
示例8: GetClipboardContentTsmi
public ToolStripMenuItem GetClipboardContentTsmi(ToolStripDropDownButton tsddb, ClipboardContentEnum et)
{
foreach (ToolStripMenuItem tsmi in tsddb.DropDownItems)
{
if ((ClipboardContentEnum)tsmi.Tag == et)
{
return tsmi;
}
}
return new ToolStripMenuItem();
}
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:11,代码来源:DestSelector.cs
示例9: StreamDetailsControl
public StreamDetailsControl()
{
SuspendLayout();
_lastWriteTime = new ToolStripLabel();
_fileSize = new ToolStripLabel();
_contentType = new ToolStripDropDownButton
{
DisplayStyle = ToolStripItemDisplayStyle.Text
};
_encoding = new ToolStripLabel();
_bom = new ToolStripLabel
{
Text = "BOM"
};
_lineEnding = new ToolStripLabel();
Items.AddRange(new ToolStripItem[]
{
_lastWriteTime,
_fileSize,
_contentType,
_encoding,
_bom,
_lineEnding
});
Renderer = ToolStripSimpleRenderer.Instance;
LastWriteTime = null;
FileSize = null;
HaveBom = false;
LineTermination = null;
Encoding = null;
ContentType = null;
ResumeLayout(false);
PerformLayout();
foreach (string name in _highlighterNames)
{
var item = new ToolStripMenuItem
{
Text = name == _defaultHighlighterName ? Labels.PlainText : name,
Tag = name
};
item.Click += item_Click;
_contentType.DropDownItems.Add(item);
}
}
开发者ID:netide,项目名称:netide,代码行数:51,代码来源:StreamDetailsControl.cs
示例10: RecentProjectsMenu
public RecentProjectsMenu() : base(TextHelper.GetString("Label.RecentProjects"))
{
ToolbarSelector = new ToolStripDropDownButton();
ToolbarSelector.Text = TextHelper.GetString("Label.RecentProjects").Replace("&", "");
ToolbarSelector.DisplayStyle = ToolStripItemDisplayStyle.Image;
ToolbarSelector.Image = Icons.Project.Img;
ToolbarSelector.Enabled = false;
string text = TextHelper.GetString("Label.ClearRecentProjects");
clearItemMenu = new ToolStripMenuItem(text);
clearItemMenu.Click += delegate{ ClearAllItems(); };
clearItemToolbar = new ToolStripMenuItem(text);
clearItemToolbar.Click += delegate { ClearAllItems(); };
RebuildList();
}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:14,代码来源:RecentProjectsMenu.cs
示例11: NuevaBotonDesplegable
public void NuevaBotonDesplegable(String Nombre, Bitmap Imagen)
{
Titulo();
tsdListaDesplegable = new ToolStripDropDownButton();
tsdListaDesplegable.Name = Nombre;
tsdListaDesplegable.Text = " " + Nombre;
tsdListaDesplegable.Font = new Font("Century Gothic", 12);
tsdListaDesplegable.TextAlign = ContentAlignment.MiddleLeft;
tsdListaDesplegable.Click += new EventHandler(CargarFormulario);
tsdListaDesplegable.Image = Imagen;
tsdListaDesplegable.ImageScaling = ToolStripItemImageScaling.None;
tsdListaDesplegable.ImageAlign = ContentAlignment.MiddleLeft;
tsdListaDesplegable.ForeColor = Color.LightGray;
this.MenuAdmin.Items.Add(tsdListaDesplegable);
}
开发者ID:EbricenterOrg,项目名称:Seguridad,代码行数:15,代码来源:Constructor.cs
示例12: FilterBranchHelper
public FilterBranchHelper(ToolStripComboBox toolStripBranches, ToolStripDropDownButton toolStripDropDownButton2, RevisionGrid RevisionGrid)
: this()
{
this._NO_TRANSLATE_toolStripBranches = toolStripBranches;
this._NO_TRANSLATE_toolStripDropDownButton2 = toolStripDropDownButton2;
this._NO_TRANSLATE_RevisionGrid = RevisionGrid;
this._NO_TRANSLATE_toolStripDropDownButton2.DropDownItems.AddRange(new ToolStripItem[] {
this.localToolStripMenuItem,
this.remoteToolStripMenuItem});
this._NO_TRANSLATE_toolStripBranches.DropDown += this.toolStripBranches_DropDown;
this._NO_TRANSLATE_toolStripBranches.TextUpdate += this.toolStripBranches_TextUpdate;
this._NO_TRANSLATE_toolStripBranches.Leave += this.toolStripBranches_Leave;
this._NO_TRANSLATE_toolStripBranches.KeyUp += this.toolStripBranches_KeyUp;
}
开发者ID:Copro,项目名称:gitextensions,代码行数:16,代码来源:FilterBranchHelper.cs
示例13: SetText
public static void SetText(ToolStripDropDownButton dropdownButton, string text)
{
MethodInvoker miSetText = delegate
{
dropdownButton.Text = text;
};
if (dropdownButton.Owner.InvokeRequired)
{
dropdownButton.Owner.Invoke(miSetText);
}
else
{
miSetText();
}
}
开发者ID:NORENBUCH,项目名称:XrmToolBox,代码行数:16,代码来源:ToolStripStatusDelegates.cs
示例14: PathHistoryToolbar
/// <summary>Initializes a new instance of the <see cref="PathHistoryToolbar"/> class.</summary>
/// <param name="view">Host history view.</param>
public PathHistoryToolbar(PathHistoryView view)
{
_view = view;
_view.LogOptionsChanged += OnLogOptionsChanged;
Items.AddRange(
new ToolStripItem[]
{
// left-aligned
_btnRefresh = new ToolStripButton(Resources.StrRefresh, CachedResources.Bitmaps["ImgRefresh"], OnRefreshButtonClick)
{
DisplayStyle = ToolStripItemDisplayStyle.Image,
},
new ToolStripSeparator(),
_btnDateOrder = new ToolStripButton(Resources.StrDateOrder, CachedResources.Bitmaps["ImgDateOrder"], OnDateOrderButtonClick)
{
Checked = _view.LogOptions.Order == RevisionQueryOrder.DateOrder,
DisplayStyle = ToolStripItemDisplayStyle.Image,
},
_btnTopoOrder = new ToolStripButton(Resources.StrTopoOrder, CachedResources.Bitmaps["ImgTopoOrder"], OnTopoOrderButtonClick)
{
Checked = _view.LogOptions.Order == RevisionQueryOrder.TopoOrder,
DisplayStyle = ToolStripItemDisplayStyle.Image,
},
new ToolStripSeparator(),
_btnLimit = new ToolStripDropDownButton(string.Empty, null,
new ToolStripItem[]
{
new ToolStripMenuItem(Resources.StrlUnlimited, null, OnLimitOptionClick) { Tag = 0 },
new ToolStripMenuItem( "100 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 100 },
new ToolStripMenuItem( "500 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 500 },
new ToolStripMenuItem("1000 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 1000 },
new ToolStripMenuItem("2000 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 2000 },
new ToolStripMenuItem("5000 " + Resources.StrlCommits, null, OnLimitOptionClick) { Tag = 5000 },
}),
// right-aligned
_btnShowDetails = new ToolStripButton(Resources.StrAutoShowDiff, CachedResources.Bitmaps["ImgDiff"], OnShowDetailsButtonClick)
{
Checked = _view.ShowDetails,
DisplayStyle = ToolStripItemDisplayStyle.ImageAndText,
Alignment = ToolStripItemAlignment.Right,
}
});
UpdateLimitButtonText();
}
开发者ID:Kuzq,项目名称:gitter,代码行数:48,代码来源:PathHistoryToolBar.cs
示例15: FilterBranchHelper
public FilterBranchHelper(ToolStripComboBox toolStripBranches, ToolStripDropDownButton toolStripDropDownButton2, RevisionGrid RevisionGrid)
: this()
{
this._NO_TRANSLATE_toolStripBranches = toolStripBranches;
this._NO_TRANSLATE_toolStripDropDownButton2 = toolStripDropDownButton2;
this._NO_TRANSLATE_RevisionGrid = RevisionGrid;
this._NO_TRANSLATE_toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.localToolStripMenuItem,
this.remoteToolStripMenuItem});
this._NO_TRANSLATE_toolStripBranches.DropDown += new System.EventHandler(this.toolStripBranches_DropDown);
this._NO_TRANSLATE_toolStripBranches.TextUpdate += new System.EventHandler(this.toolStripBranches_TextUpdate);
this._NO_TRANSLATE_toolStripBranches.Leave += new System.EventHandler(this.toolStripBranches_Leave);
this._NO_TRANSLATE_toolStripBranches.KeyUp += new System.Windows.Forms.KeyEventHandler(this.toolStripBranches_KeyUp);
InitToolStripBranchFilter();
}
开发者ID:rschoening,项目名称:gitextensions,代码行数:18,代码来源:RevisionGrid.cs
示例16: InitializeComponent
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(NameFilterControl));
this.tsName = new ToolStrip();
this.tslName = new ToolStripLabel();
this.tsddNameCondition = new ToolStripDropDownButton();
this.tsmiConditionEqual = new ToolStripMenuItem();
this.tsmiConditionNotEqual = new ToolStripMenuItem();
this.tslMask = new ToolStripLabel();
this.tstbMask = new ToolStripTextBox();
this.tsName.SuspendLayout();
base.SuspendLayout();
this.tsName.BackColor = Color.Transparent;
manager.ApplyResources(this.tsName, "tsName");
this.tsName.GripStyle = ToolStripGripStyle.Hidden;
this.tsName.Items.AddRange(new ToolStripItem[] { this.tslName, this.tsddNameCondition, this.tslMask, this.tstbMask });
this.tsName.Name = "tsName";
this.tslName.Name = "tslName";
manager.ApplyResources(this.tslName, "tslName");
this.tsddNameCondition.DisplayStyle = ToolStripItemDisplayStyle.Text;
this.tsddNameCondition.DropDownItems.AddRange(new ToolStripItem[] { this.tsmiConditionEqual, this.tsmiConditionNotEqual });
manager.ApplyResources(this.tsddNameCondition, "tsddNameCondition");
this.tsddNameCondition.Name = "tsddNameCondition";
this.tsmiConditionEqual.Name = "tsmiConditionEqual";
manager.ApplyResources(this.tsmiConditionEqual, "tsmiConditionEqual");
this.tsmiConditionEqual.Click += new EventHandler(this.tsmiConditionEqual_Click);
this.tsmiConditionNotEqual.Name = "tsmiConditionNotEqual";
manager.ApplyResources(this.tsmiConditionNotEqual, "tsmiConditionNotEqual");
this.tsmiConditionNotEqual.Click += new EventHandler(this.tsmiConditionEqual_Click);
this.tslMask.Name = "tslMask";
manager.ApplyResources(this.tslMask, "tslMask");
this.tstbMask.BorderStyle = BorderStyle.FixedSingle;
manager.ApplyResources(this.tstbMask, "tstbMask");
this.tstbMask.Name = "tstbMask";
this.tstbMask.TextChanged += new EventHandler(this.tstbMask_TextChanged);
manager.ApplyResources(this, "$this");
base.AutoScaleMode = AutoScaleMode.Font;
base.Controls.Add(this.tsName);
base.Name = "NameFilterControl";
this.tsName.ResumeLayout(false);
this.tsName.PerformLayout();
base.ResumeLayout(false);
base.PerformLayout();
}
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:44,代码来源:NameFilterControl.cs
示例17: FilterRevisionsHelper
public FilterRevisionsHelper(ToolStripTextBox toolStripTextBoxFilter, ToolStripDropDownButton toolStripDropDownButton1, RevisionGrid RevisionGrid, ToolStripLabel toolStripLabel2, Form form)
: this()
{
this._NO_TRANSLATE_toolStripDropDownButton1 = toolStripDropDownButton1;
this._NO_TRANSLATE_toolStripTextBoxFilter = toolStripTextBoxFilter;
this._NO_TRANSLATE_RevisionGrid = RevisionGrid;
this._NO_TRANSLATE_toolStripLabel2 = toolStripLabel2;
this._NO_TRANSLATE_form = form;
this._NO_TRANSLATE_toolStripDropDownButton1.DropDownItems.AddRange(new ToolStripItem[] {
this.commitToolStripMenuItem1,
this.committerToolStripMenuItem,
this.authorToolStripMenuItem,
this.diffContainsToolStripMenuItem});
this._NO_TRANSLATE_toolStripLabel2.Click += this.ToolStripLabel2Click;
this._NO_TRANSLATE_toolStripTextBoxFilter.Leave += this.ToolStripTextBoxFilterLeave;
this._NO_TRANSLATE_toolStripTextBoxFilter.KeyPress += this.ToolStripTextBoxFilterKeyPress;
}
开发者ID:Carbenium,项目名称:gitextensions,代码行数:19,代码来源:FilterRevisionsHelper.cs
示例18: InitCopyDropDown
public static void InitCopyDropDown(this ListView lvwuse,ToolStripDropDownButton tsbutton,String ContentsName,String GroupColumnName,
Action<String, DropDownItemListViewCopyData> ActionDelegate)
{
//set image and text of the dropdownbutton.
tsbutton.Image = JobClockConfig.Imageman.GetLoadedImage("copy_s");
//set text...
tsbutton.Text = "Copy";
//add a ghost item to the drop down, so it will fire the DropDownOpeningEvent. Actually come to think of it this might not be necessary. Best not to ask
//too many questions, though.
tsbutton.DropDownItems.Add("GHOST");
//hook the "DropDownOpening" event.
tsbutton.DropDownOpening += new EventHandler(tsbutton_DropDownOpening);
//set the button's tag to a new data object, which will be used in the DropDown and succeeding button Click Events.
tsbutton.Tag = new DropDownListViewCopyData(lvwuse, tsbutton, ContentsName,GroupColumnName,ActionDelegate);
//That's IT!
}
开发者ID:BCProgramming,项目名称:BCJobClock,代码行数:20,代码来源:ExtendDbReader.cs
示例19: ToolStripLogsGui
public ToolStripLogsGui()
{
this.mButtonFormat = new ToolStripDropDownButton()
{
Text = "Format",
};
this.mButtonColors = new ToolStripDropDownButton()
{
Text = "Colors",
};
this.mButtonClear = new ToolStripButton()
{
Text = "Clear"
};
this.mButtonClear.Click += new EventHandler(mButtonClear_Click);
this.Items.AddRange(new ToolStripItem[] { this.mButtonFormat, this.mButtonColors, this.mButtonClear });
this.mLogger = null;
}
开发者ID:riuson,项目名称:com232term,代码行数:22,代码来源:ToolStripLogsGui.cs
示例20: Create
public static ToolStrip Create(ToolStrip strip
, OutlinerSplitContainer container
, OutlinerTree::TreeView tree
, TreeMode treeMode)
{
OutlinerGUP outliner = OutlinerGUP.Instance;
OutlinerColorScheme colorScheme = outliner.ColorScheme;
strip.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow;
strip.Tag = new Tuple<OutlinerSplitContainer, OutlinerTree::TreeView, TreeMode>(container, tree, treeMode);
strip.Padding = new Padding(3, 2, 1, 1);
strip.Renderer = new OutlinerToolStripRenderer(colorScheme.ContextMenuColorTable);
ToolStripDropDownButton preset_btn = new ToolStripDropDownButton(ContextMenuResources.Context_Preset);
OutlinerPreset currentPreset = OutlinerGUP.Instance.GetActivePreset(tree);
preset_btn.Image = currentPreset.Image24;
preset_btn.DropDownDirection = ToolStripDropDownDirection.BelowRight;
IEnumerable<OutlinerPreset> presets = Configurations.GetConfigurations<OutlinerPreset>(OutlinerPaths.PresetsDir);
foreach (OutlinerPreset preset in presets.Where(p => p.IsDefaultPreset))
{
//ToolStripMenuItem item = AddDropDownItem(preset_btn.DropDownItems, preset.Text, preset.Image16, preset_btn_click, preset);
//item.Checked = preset.Text == currentPreset.Text;
}
preset_btn.DropDownItems.Add(new ToolStripSeparator());
foreach (OutlinerPreset preset in presets.Where(p => !p.IsDefaultPreset))
{
//ToolStripMenuItem item = AddDropDownItem(preset_btn.DropDownItems, preset.Text, preset.Image16, preset_btn_click, preset);
//item.Checked = preset.Text == currentPreset.Text;
}
strip.Items.Add(preset_btn);
strip.Items.Add(new ToolStripSeparator());
SetDefaultItemProperties(strip);
return strip;
}
开发者ID:Sugz,项目名称:Outliner-3.0,代码行数:39,代码来源:Toolbar.cs
注:本文中的System.Windows.Forms.ToolStripDropDownButton类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论