We're going to display a simple message box when the button is clicked.So we need a coding window.
To see the code for the button double click the button you added to the form. the coding window will open, and your cursor will be inside of the button code. It will look like this:
We want to display a message box, with some text on it. This is quite easy to do in C#.
Position your cursor between the two curly brackets. Then type a capital letter "M". You'll see the IntelliSense list appear:
After type 'ess' You'll see the IntelliSense list appear:
When you have MessageBox selected, hit the enter key on your keyboard (or double click the entry on the list). The code will be added for you:
After that type '.show' and then type message which you want to display in the message box.
The code window will look like this.
Run your programme by clicking Debug > Start Debugging. Or just press the F5 key on your keyboard. Your programme will look like this:
Click your button to see your Message Box:
Happy Programming..:)
To see the code for the button double click the button you added to the form. the coding window will open, and your cursor will be inside of the button code. It will look like this:
Position your cursor between the two curly brackets. Then type a capital letter "M". You'll see the IntelliSense list appear:
After type 'ess' You'll see the IntelliSense list appear:
When you have MessageBox selected, hit the enter key on your keyboard (or double click the entry on the list). The code will be added for you:
After that type '.show' and then type message which you want to display in the message box.
The code window will look like this.
Run your programme by clicking Debug > Start Debugging. Or just press the F5 key on your keyboard. Your programme will look like this:
Happy Programming..:)
Comments
Post a Comment