Exforsys.com
 
Home Tutorials VB.NET 2005
 

Setting and Adding Properties to Windows Form

 

Setting and Adding Properties to Windows Form

Page 1 of 2

Setting and Adding Properties to a Windows Form

In this tutorial we wil leran about Setting and Adding Properties to a Windows Form, Using the Visual Designer to set Windows Form Properties, Setting Windows Forms Properties programatically and Using Visual Inheritance along with the sample project and screen shots.



Using the Visual Designer to set Windows Form Properties

The properties of the Widows properties can be edited in the properties window visually. Both the inherited properties and also those added in the current class can be edited using the property window. If this window is not visible, you can click on the menu view and choose property window. Alternatively you can click F4 to invoke this window.


This window can be docked to a side and can be hidden or pinned to the desk. If it is hidden then if the mouse hovers over the title bar of the property window it then becomes visible. We and see how the properties of a text box and a grid control can be edited in the illustration:



In the above screen shot, see the button titled OK and all the properties of the button are available so that it can changed.

We can also see another illustration involving grid box control: The screen shot below displays properties that can be changed.



Setting Windows Forms Properties programmatically


You may have a clear idea of value of the properties and the controls at design time and they can be edited using the method explained above. However most of the time the value of the property of several items cannot be identified at design time and they have to be set at run time based on several considerations. Visual Basic provides facility to edit and initialize or substitute the value of the properties programmatically. Le us see an illustration.

Start a new project and add a form to the project. This form will be the starting form by default. Add two text boxes and a command button to the form and place them as shown below:



Now you can proceed to add the codes for the program by double clicking the form. You will see the controls.vb file opened. Add the following codes to the form as given below:


Click here to view the Source Code


Next Page: Setting and Adding Properties to Windows Form - Page 2


Read Next: Event Handling In Visual Basic .NET



 

 

Comments


fikmesf said:

  ::) How do I see the source code? every time I tried it gives me no authorization message. What should I do? please advise me

Mesfin
July 18, 2006, 5:57 am

vin said:

  its good site
April 3, 2007, 7:52 pm

sheetalraysoni said:

  ::) How do I see the source code? every time I tried it gives me no authorization message. What should I do? please advise me
October 3, 2007, 2:58 am

Ahmed_757 said:

  It is very difficult to see the code, would you please solve this problem
April 22, 2008, 3:01 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2010 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape