Vortex86DX-MSJK Windows Embedded CE 6.0 R3 Jump Start Rev 2.2
Page 81 of 144
Add Codes and Build the Application Project
In the following steps, we will make some changes and add some simple code to the application:
•
Resize
Form1
to a smaller size, 320 x 240.
•
Change
Form1
’s caption to “VS2008 Managed Code Hello World”.
•
Delete the
mainMenu1
component from the project.
•
Add a text box to
Form1
, change the name to
textHelloWorld
, clear the default content and
place the text box at the center of the form.
•
Add a button to
Form1
, change the name to
buttonHelloWorld
, change the caption to
“Hello World” and place the button to the center of the form, just below the
textHelloWorld
text box.
•
Double click on the Hello World button to bring up the source code window showing the
buttonHelloWorld_Click
event code.
•
Add the following codes to the
buttonHelloWorld_Click
event:
private
void
buttonHelloWorld_Click(
object
sender,
EventArgs
e)
{
textHelloWorld.Text =
"Hello World!"
;
textHelloWorld.Text =
"2nd Hello World!"
;
textHelloWorld.Text =
"3rd Hello World!"
;
textHelloWorld.Text =
"Final Hello World!"
;
}
The VS2008 IDE should look similar to the following, as shown in Figure 83.
Fig. 83 -
Visual Studio 2008 IDE
From the VS2008 IDE, select
Build | Build Solution
to build the
VS2008_CSharp_HelloWorld
project.