Changes between Version 1 and Version 2 of CreateaSimpleUserInterface
- Timestamp:
- 2009-08-18 11:24:09 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CreateaSimpleUserInterface
v1 v2 2 2 This article will teach you how to create a Button, Label and a Textbox control. 3 3 4 1. On the File menu, choose New Project. 4 1. On the File menu, choose New Project. [[br]] 5 [[Image(1- FileNewProject (Custom).jpg)]] 5 6 7 2. In the New Project dialog box, in the Templates pane, click Windows Application. [[br]] 6 8 7 2. In the New Project dialog box, in the Templates pane, click Windows Application. 9 3. In the Name box, type !TextBoxExample, and then click OK. 10 11 A new Windows Forms project opens. [[br]] 12 [[Image(2 - Windows Application (Custom).jpg)]] 13 8 14 9 15 10 16 11 3. In the Name box, type !TextBoxExample, and then click OK. 17 4. From the Toolbox, drag a !TextBox, Label, and Button control onto the form. [[br]] 18 [[Image(4 - Add Controls (Custom).jpg)]] 12 19 13 A new Windows Forms project opens.14 20 15 21 16 22 17 4. From the Toolbox, drag a !TextBox, Label, and Button control onto the form. 23 5. Select the Label control and drag it above the !TextBox control [[br]] 24 [[Image(5 - Align Controls (Custom).jpg)]] 18 25 19 20 21 5. Select the Label control and drag it above the !TextBox control22 26 23 27 … … 25 29 6. In the Properties window, change the Text property of the Label control to the following code. 26 30 27 Enter your name and click the button. 31 Enter your name and click the button. [[br]] 32 [[Image(6 - Change Label Text (Custom).jpg)]] 33 28 34 29 35 … … 36 42 37 43 1. Double-click the Button control to open the Code Editor. 38 39 40 41 The Code Editor opens the Button1_Click event handler.44 The Code Editor opens the Button1_Click event handler. [[br]] 45 [[Image(2.1 - DoubleClick Button (Custom).jpg)]] 46 [[br]] 47 [[Image(2.1a - Double Click Button (Custom).jpg)]] 42 48 43 49 … … 48 54 {{{ 49 55 MsgBox("Your Name is " & Textbox1.Text) 50 }}} 56 }}} 57 [[br]] 58 [[Image(2.2 - Add Message (Custom).jpg)]] 59 51 60 52 61 53 62 54 63 55 3. Press F5 to run your program. 64 3. Press F5 to run your program. [[br]] 65 [[Image(2.3 - Press F5 (Custom).jpg)]] 66 56 67 57 68 58 69 59 4. 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. 70 4. 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. [[br]] 71 [[Image(2 (Custom).jpg)]] 72 60 73 61 74