
VDX-6318 Windows Embedded Compact 7 - Getting Started Guide
Windows Embedded Compact 7 Getting Started Rev 2.00
Page 60
Add Codes and Build the Application Project
In the following steps, you will make changes and add codes to the project:
Resize
Form1
to a smaller size or to fit the target device’s display resolution. For this
exercise, resize
Form1
to 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
textHelloWorld
at the center of
Form1
.
Add a
button control
to
Form1
, change the name to
buttonHelloWorld
, change the caption
to “
Hello World
” and place
buttonHelloWorld
to the center of
Form1
, just below
textHelloWorld
.
Double click on
buttonHelloWorld
(Hello World button) to bring up the source code window
showing the
buttonHelloWorld_Click
event handler.
Add the following codes to the
buttonHelloWorld_Click
event handler:
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 58.
Fig. 58 -
Visual Studio 2008 IDE
From the VS2008 menu, select
Build → Build Solution
to build the
VS2008_CSharp_HelloWorld
managed code application.