System.Windows.Forms.Button.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
		public override string ToString ()
		{
			return base.ToString () + ", Text: " + this.Text;
		}
		#endregion	// Public Methods

Usage Example

        //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);
        }
All Usage Examples Of System.Windows.Forms.Button::ToString