当前位置: 首页>>代码示例>>C#>>正文


C# ToolStripButton.ToString方法代码示例

本文整理汇总了C#中System.Windows.Forms.ToolStripButton.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStripButton.ToString方法的具体用法?C# ToolStripButton.ToString怎么用?C# ToolStripButton.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ToolStripButton的用法示例。


在下文中一共展示了ToolStripButton.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Accessibility

		public void Accessibility ()
		{
			ToolStripButton tsi = new ToolStripButton ();
			AccessibleObject ao = tsi.AccessibilityObject;

			Assert.AreEqual ("ToolStripItemAccessibleObject: Owner = " + tsi.ToString (), ao.ToString (), "L");
			Assert.AreEqual (Rectangle.Empty, ao.Bounds, "L1");
			Assert.AreEqual ("Press", ao.DefaultAction, "L2");
			Assert.AreEqual (null, ao.Description, "L3");
			Assert.AreEqual (null, ao.Help, "L4");
			Assert.AreEqual (string.Empty, ao.KeyboardShortcut, "L5");
			Assert.AreEqual (string.Empty, ao.Name, "L6");
			Assert.AreEqual (null, ao.Parent, "L7");
			Assert.AreEqual (AccessibleRole.PushButton, ao.Role, "L8");
			Assert.AreEqual (AccessibleStates.Focusable, ao.State, "L9");
			Assert.AreEqual (string.Empty, ao.Value, "L10");

			tsi.Name = "Label1";
			tsi.Text = "Test Label";
			tsi.AccessibleDescription = "Label Desc";

			Assert.AreEqual (Rectangle.Empty, ao.Bounds, "L11");
			Assert.AreEqual ("Press", ao.DefaultAction, "L12");
			Assert.AreEqual ("Label Desc", ao.Description, "L13");
			Assert.AreEqual (null, ao.Help, "L14");
			Assert.AreEqual (string.Empty, ao.KeyboardShortcut, "L15");
			Assert.AreEqual ("Test Label", ao.Name, "L16");
			Assert.AreEqual (null, ao.Parent, "L17");
			Assert.AreEqual (AccessibleRole.PushButton, ao.Role, "L18");
			Assert.AreEqual (AccessibleStates.Focusable, ao.State, "L19");
			Assert.AreEqual (string.Empty, ao.Value, "L20");

			tsi.AccessibleName = "Access Label";
			Assert.AreEqual ("Access Label", ao.Name, "L21");

			tsi.Text = "Test Label";
			Assert.AreEqual ("Access Label", ao.Name, "L22");

			tsi.AccessibleDefaultActionDescription = "AAA";
			Assert.AreEqual ("AAA", tsi.AccessibleDefaultActionDescription, "L23");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:41,代码来源:ToolStripButtonTest.cs


注:本文中的System.Windows.Forms.ToolStripButton.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。