Thanks for using this pre-release version of Visual J++.
This procedure shows you how to create a Windows application with the WFC Designer and controls. The application created populates a list box with a string whenever the applicationÆs button is clicked. Once youÆve compiled the application cleanly, you will run it from the development environment.
Tip Before beginning the following procedure, close all open projects by clicking Close All from the File menu.
To open the WFC Designer when creating a Windows application with WFC controls
Note Expand items in the environment by either double-clicking a folder or single-clicking a ô+ö sign to the left of a folder.
ûorû
Click the Browse button to navigate to the folder where you want to save your project.
A collapsed view of your application project appears in Project Explorer.
The WFC Designer appears and is ready to accept WFC controls from the Toolbox.
To add WFC controls to the WFC Designer
Note Once the control has been placed on the form, you may move it to a different location when the arrow changes to a move cursor over the control. You may adjust its size with the controlÆs sizing handles.
Now the button on the form displays the new value.
Since youÆll be displaying text in the ListBox control, adjust its size to hold several lines of text.
To add a button click event handler
A Text editor window opens to an empty event handler for the buttonÆs click event.
button1_Click()
event handler, add the following code:
listBox1.addItem(ôThis is a new string.ö);
When youÆve finished this step, the event handler look like this:
private void button1_Click(Object sender, Event e)
{
listBox1.addItem(ôThis is a new string.ö);
}
To build a WFC application
If your application has any compilation errors or messages, they will appear in the Task List. Correct the errors and rebuild your application until there are no compiler messages in the Task List.
To see the results of the code youÆve added to the Windows Application template, you will need to run the application. See Running a WFC Application from the Environment for details to run the application from within the Visual J++ environment.