Using the Windows Forms Designer

Now that you see how simple it is to create a basic Windows Forms application, let's see how to gain even more productivity using the C#Builder IDE tools. The quickest way to get started is by running the Windows Forms Application Wizard. Choose File, New, Other (or right-click on the current Project Group in the Project Manager and choose Add New Project). Then select the C# Projects folder in the New Items dialog, and double-click the Application icon. After you add a project name and location and click the OK button, the wizard generates a Windows Forms designer surface (see Figure 6.3). The Object Inspector is populated with properties for the Form class and the Tool Palette is filled with drag-and-drop controls.

Figure 6.3. The Windows Forms designer.

graphics/06fig03.jpg

At the bottom of the designer surface frame are two tabs, Code and Designer. The Designer tab is selected in Figure 6.3, showing the Windows Forms designer surface. Selecting the Code tab displays the code editor.

At the top of the designer surface are two toolbars that assist in positioning controls. The control alignment buttons are grayed out by default, but they come alive whenever multiple controls are selected. To try this out, drag a few controls from the Tool Palette to the designer surface. To select multiple controls simultaneously, select one of the controls and press Ctrl+Click or Shift+Click for other controls that you specifically want to work with. To select a group of controls in the same physical area, hold down the mouse button on one corner of the area to select and drag the mouse to the other corner. This will select every control in the rectangular area selected. Use Ctrl+Click or Shift+Click to deselect any controls that were accidentally selected.

Everything in the entire IDE is interactive, affecting other components as you work. Changing code that affects visual properties of the form will change the form on the designer surface, and property value changes will reflect in the Object Inspector. Likewise, changes in a property in the Object Inspector will modify code, and dragging and dropping components from the Tool Palette will also modify code.



C# Builder KickStart
C# Builder KickStart
ISBN: 672325896
EAN: N/A
Year: 2003
Pages: 165

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net