7.2 Changing a Form s Properties

 <  Day Day Up  >  

7.2 Changing a Form's Properties

You want to change certain properties of the form within your application.


Technique

Select the form within the designer by clicking on it. The available properties for the form appear in the Properties windows , which by default is located at the bottom right of the IDE window, as shown in Figure 7.1. If the Properties window is not visible, click on View, Properties from the main menu.

Figure 7.1. Visual Studio .NET Property Browser.

graphics/07fig01.gif

Each property has a designer control associated with it, which means that each property has a different way to change its value. The Text property, which changes the main title of the form, uses an edit box to change its value. To change the form's title , type a new string into the edit box for the Text property. Some controls use a drop-down box listing all possible values the property contains. For instance, to remove the taskbar button that is displayed when your application runs, click on the ShowInTaskbar property drop-down box and select False .

Comments

Properties define an object's characteristics, whereas you use methods on an object to define its behavior. You can declare properties using any data type, which means creating a visual property editor is no trivial task. The property editor within the Visual Studio .NET IDE is an advanced control that provides a default set of suitable controls you use to set the value or values of a property. Furthermore, the property editor is extendable, which means you are free to create property controls that work better with the property data type you created. For more information on custom property editors, see Chapter 9, "User Controls."

One thing you'll notice as you work within the IDE is the versatility of the property browser. In this chapter, you just change the properties of a Windows Form, but you can also use the property browser to change properties on the controls within a Windows Form, solution and project properties, and even properties on an individual file. Additionally, you can control how you see the properties by using the view buttons at the top of the property browser window. The first button groups the properties based on their category. A Windows Form contains categories such as Accessibility , Appearance , and Window Style . You can also arrange properties alphabetically by using the Alphabetic toolbar button on the property browser.

 <  Day Day Up  >  


Microsoft Visual C# .Net 2003
Microsoft Visual C *. NET 2003 development skills Daquan
ISBN: 7508427505
EAN: 2147483647
Year: 2003
Pages: 440

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