Home

Introduction to Application Design

 

Visual Control Addition

 

Introduction

To add a control to your application, you can select it from the Toolbox and click the desired area on the form. Once added, the control is positioned where your mouse landed. In the same way, you can add other controls as you judge them necessary for your application. Here is an example of a few controls added to a form:

Form1

Alternatively, to add a control, you can also double-click it from the Toolbox and it would be added to the top-left section of the form.

If you want to add a certain control many times, before selecting it on the Toolbox, press and hold Ctrl. Then click it in the Toolbox. This permanently selects the control. Every time you click the form, the control would be added. Once you have added the desired number of this control, on the Toolbox, click the Pointer button to dismiss the control.

Practical LearningPractical Learning: Using the Toolbox

  1. Start Microsoft Visual C#
  2. To create a new application, on the main menu, click File -> New Project...
  3. In the Templates list, click Windows Application
  4. Set the Name to DesignPractice1 and click OK
  5. On the main menu, click View -> Toolbox.
    Position the mouse on the Toolbox word and wait for the Toolbox to expand
  6. Click the Label button Label and position the mouse on the form
     
    Form Design
  7. Click the form
  8. Click the middle of the form to select it (the form)
  9. To add another control, position the mouse again on the Toolbox word until the Toolbox has expanded
  10. Find and double-click the TextBox button TextBox
  11. To use a hidden area of the form, position the mouse on the Toolbox word. When the Toolbox has expanded, click the Auto Hide button AutoHide
  12. On the Toolbox, click the TreeView button TreeView and click the left section of the form
  13. After using the Toolbox, to hide it, click the Auto Hide button AutoHide
  14. To execute the application, on the main menu, click Debug -> Start Without Debugging
  15. After using it, close the form and return to your programming environment

Copying a Control

We mentioned earlier how you could add a control many times. An alternative is to copy a control. To do this, on the form:

  • Right-click the control and click Copy. Right-click another area of the form and click Paste
  • Click (once) the control you want to copy
     


    Press and hold Ctrl. Then drag the selected control to another area of the form. The mouse cursor would display a + plus indicating that the control is being duplicated:
     


    Once you get to another area of the form, release the mouse and Ctrl

You can use these two techniques to copy a group of controls.

 

Home Copyright © 2007 FunctionX, Inc. Next