本文整理汇总了C#中System.Windows.Forms.StatusStrip.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# StatusStrip.Dispose方法的具体用法?C# StatusStrip.Dispose怎么用?C# StatusStrip.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.StatusStrip
的用法示例。
在下文中一共展示了StatusStrip.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BehaviorFindToolStrip
public void BehaviorFindToolStrip ()
{
// Default stuff
Assert.AreEqual (null, ToolStripManager.FindToolStrip (string.Empty), "A1");
Assert.AreEqual (null, ToolStripManager.FindToolStrip ("MyStrip"), "A2");
ToolStrip ts = new ToolStrip ();
ts.Name = "MyStrip";
// Basic operation
Assert.AreSame (ts, ToolStripManager.FindToolStrip ("MyStrip"), "A3");
// Dispose removes them
ts.Dispose ();
Assert.AreEqual (null, ToolStripManager.FindToolStrip ("MyStrip"), "A4");
ts = new ToolStrip ();
ts.Name = "MyStrip1";
MenuStrip ms = new MenuStrip ();
ms.Name = "MyStrip2";
// Basic operation
Assert.AreSame (ts, ToolStripManager.FindToolStrip ("MyStrip1"), "A5");
Assert.AreSame (ms, ToolStripManager.FindToolStrip ("MyStrip2"), "A6");
// Find unnamed strip
StatusStrip ss = new StatusStrip ();
Assert.AreEqual (ss, ToolStripManager.FindToolStrip (string.Empty), "A7");
// Always return first unnamed strip
ContextMenuStrip cms = new ContextMenuStrip ();
Assert.AreEqual (ss, ToolStripManager.FindToolStrip (string.Empty), "A8");
// Remove first unnamed strip, returns second one
ss.Dispose ();
Assert.AreEqual (cms, ToolStripManager.FindToolStrip (string.Empty), "A9");
// ContextMenuStrips are included
cms.Name = "Context";
Assert.AreEqual (cms, ToolStripManager.FindToolStrip ("Context"), "A10");
}