Adding a Control by Double-Clicking It in the Toolbox


The easiest way to add a control to a form is to double-click the control in the tool-box. Try this now: Display the toolbox and double-click the TextBox tool. Visual C# creates a new text box in the upper-left corner of the form (you'll have to move the mouse away from the toolbox to close the toolbox and see the new control). When you double-click a control in the toolbox (excluding controls that are invisible at runtime), Visual C# creates the new control on top of the control that currently has the focus, with the default size for the type of control you're adding. If no other controls are on the form, the new control is placed in the upper-left corner as you've seen here. After the control is added to the form, you're free to move and size the text box as you please. A text box cannot be resized unless its Multiline property is set to True. Set it to True now.




Sams Teach Yourself Microsoft Visual C# 2005 in 24 Hours, Complete Starter Kit
Sams Teach Yourself Visual C# 2005 in 24 Hours, Complete Starter Kit
ISBN: 0672327406
EAN: 2147483647
Year: N/A
Pages: 248
Authors: James Foxall

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