本文整理汇总了C#中System.Windows.Forms.ToolStrip.Show方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStrip.Show方法的具体用法?C# ToolStrip.Show怎么用?C# ToolStrip.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStrip
的用法示例。
在下文中一共展示了ToolStrip.Show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToolStripItems
private void AddToolStripItems()
{
try
{
ToolStrip customToolStrip = new ToolStrip();
customToolStrip.Items.Add(btnShowProperties);
customToolStrip.Items.Add(btnShowInheritance);
customToolStrip.Items.Add(btnShowDefaultProperties);
customToolStrip.Items.Add(btnShowDefaultInheritance);
customToolStrip.Items.Add(btnHostStatus);
customToolStrip.Items.Add(btnIcon);
customToolStrip.Show();
ToolStrip propertyGridToolStrip = new ToolStrip();
ToolStrip toolStrip = default(ToolStrip);
foreach (Control control in pGrid.Controls)
{
toolStrip = control as ToolStrip;
if (toolStrip != null)
{
propertyGridToolStrip = toolStrip;
break; // TODO: might not be correct. Was : Exit For
}
}
if (toolStrip == null)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strCouldNotFindToolStripInFilteredPropertyGrid, true);
return;
}
if (!_originalPropertyGridToolStripItemCountValid)
{
_originalPropertyGridToolStripItemCount = propertyGridToolStrip.Items.Count;
_originalPropertyGridToolStripItemCountValid = true;
}
Debug.Assert(_originalPropertyGridToolStripItemCount == 5);
// Hide the "Property Pages" button
propertyGridToolStrip.Items[_originalPropertyGridToolStripItemCount - 1].Visible = false;
int expectedToolStripItemCount = _originalPropertyGridToolStripItemCount + customToolStrip.Items.Count;
if (propertyGridToolStrip.Items.Count != expectedToolStripItemCount)
{
propertyGridToolStrip.AllowMerge = true;
ToolStripManager.Merge(customToolStrip, propertyGridToolStrip);
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strConfigUiLoadFailed + Constants.vbNewLine + ex.Message, true);
}
}
示例2: SetActionMenu
private void SetActionMenu(ToolStrip menuItems)
{
if (menuItems == null)
{
itemPanel.Hide();
}
else
{
if (!itemPanel.DetailArea.Contains(menuItems))
{
itemPanel.DetailArea.Controls.Add(menuItems);
menuItems.Show();
}
itemPanel.Show();
}
}