A form is added to your application through the Project menu.
Objects can be dragged from the Toolbox to the form. The form is persisted as a block of source code that defines an instance of the WFC Form class. The default Form class contains:
The Form Designer generates this code based on values set in the Properties window for each control and the form itself. Caution should be taken when modifying the initForm method since the Form Designer also reads this code when displaying the form. Conditionals such as if, while, and switch statements should be avoided, as should component methods. If you modify the initForm code, restrict changes to properties that begin with set and restrict values to constants. Do not use variables to set values.
For example:
Correct Use | setSize(10,100); |
Incorrect Use | x=10; y = 100; setSize(x,y); |
To create a form
The Add Item dialog box appears with the form templates.
The form window is displayed, showing the form surface.
The form is automatically opened in design mode if you are creating a new form from a template. If the Form Designer is not currently active, follow the below procedure to open the Form Designer.
To view the form in the Form Designer
-or-
By default, controls are aligned to the grid. The grid options can be set through the Tools/Options dialog box for Forms.
The Toolbox contains WFC Controls and may include other tabs containing ActiveX and custom controls.
Once you have the basic form template, you are ready to add controls to it.