本文整理汇总了C#中System.Windows.Forms.Button.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Button.ToString方法的具体用法?C# Button.ToString怎么用?C# Button.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Button
的用法示例。
在下文中一共展示了Button.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Observer
//sets subject, button, random object
public Observer(SubjectWithEvent subject, String observerName, Button buttonToClick, Random random)
{
this.subject = subject;
this.observerName = observerName;
this.random = random;
buttonString = buttonToClick.ToString();
//adds delegate instance containing "DoStuff" to the buttons click event
buttonToClick.Click += new System.EventHandler(DoStuff);
}
示例2: buttonSquare
private Square buttonSquare(Button button)
{
foreach (Square square in Squares.All)
{
if (button == this[square])
return square;
} // semi-colon not needed
throw new ApplicationException("invalid button " + button.ToString());
//MessageBox.Show(String.Format("invalid button {0}", button));
}
示例3: ToStringTest
public void ToStringTest ()
{
Button B1 = new Button ();
Assert.AreEqual ("System.Windows.Forms.Button, Text: " , B1.ToString (), "#9");
}