Setting control properties from code:

 

Just as you changed control properties from the properties window, you can modify them
through code. Locate a position in your code where you want to modify a controls
properties.

 

Insert a line of code with the following syntax:
control_name.propertyname = new_value


Where control_name is the name of your control, property_name is the name of the
property that you wish to modify, and where new_value is the value you wish to set.
Note- Remember to use the period (.) to separate the control from the property.

example: Text1.Text = "Hello World!"

Retrieving a property value

The process of retrieving a controls property value in code is much like setting the value
in code.


example: variable = Text1.Text

 

This example retrieves the value of the text property
from the control Text1 and places the value into the variable

 

 

 

visual basic controls by p. muthulakshmi & v. vanthana