How to add a Controls to a Blank C# Form and change TextProperty

To place a control on a form, you can use the toolbox on the left top of  Visual Studio 2010. Move your mouse over the toolbar, and click the plus symbol next to Common Controls.


Click to common controls and you can see the following list of things you can add to your form:

Adding button in Form


Click on Button or another controls example TextBox  and now click once anywhere on your form,  a button will be drawn for you and your Form will get the view:


Button in Form




The text on the button, which defaults to “ button1 “ can be changed. You can change in this way.  Click on the button with the right key, then choose the option properties.



Change Property in C#



And you can see, there is a lot of Properties for a button. Scroll down to the bottom and locate the TextProperty:


Change button text


Click inside of the  text area of  “button1” , delete the default text.


Controls to a Blank C# Form



And now type the following





And this moment press the enter key on your keyboard and the Text on the button should have changed.



Controls to a Blank C# Form




No comments:

Post a Comment