Last modified 15 years ago
Last modified on 2009-08-18 11:24:30
Create a simple user interface
This article will teach you how to create a Button, Label and a Textbox control. Note this has nothing to do with Ecopath.
- In the New Project dialog box, in the Templates pane, click Windows Application.
- In the Name box, type TextBoxExample, and then click OK.
A new Windows Forms project opens.
- In the Properties window, change the Text property of the Label control to the following code.
Enter your name and click the button.
Now that you have created a basic user interface, you will need to add a little bit of code to your program, and then it will be ready to test!
To add code and test your program
- Double-click the Button control to open the Code Editor.
The Code Editor opens the Button1_Click event handler.
- Add the following line of code to the Button1_Click event handler.
MsgBox("Your Name is " & Textbox1.Text)
- When the form appears, type your name in the TextBox control and click the button. A message box appears, displaying the text in the TextBox control. Change the text and click the button again. Each time you click the button, the updated text is displayed.
Attachments
- 1- FileNewProject (Custom).jpg (45.1 KB) - added by shermanl 15 years ago.
- 2 - Windows Application (Custom).jpg (37.6 KB) - added by shermanl 15 years ago.
- 2 (Custom).jpg (29.0 KB) - added by shermanl 15 years ago.
- 2.1 - DoubleClick Button (Custom).jpg (30.9 KB) - added by shermanl 15 years ago.
- 2.1a - Double Click Button (Custom).jpg (27.0 KB) - added by shermanl 15 years ago.
- 2.2 - Add Message (Custom).jpg (28.0 KB) - added by shermanl 15 years ago.
- 2.3 - Press F5 (Custom).jpg (25.8 KB) - added by shermanl 15 years ago.
- 4 - Add Controls (Custom).jpg (32.5 KB) - added by shermanl 15 years ago.
- 5 - Align Controls (Custom).jpg (29.1 KB) - added by shermanl 15 years ago.
- 6 - Change Label Text (Custom).jpg (31.3 KB) - added by shermanl 15 years ago.