SEB’s VB.NET Guide
Coding in .Net
The appearance of objects on the form can be changed either at design time or at run-time.
Changing Properties at design time
1.Click on the object2.Click on the property you want to change in the properties window3.Type the new value or select the value from the drop-down menu
NB: Setting properties at design time is useful for establishing initial values quickly; but setting properties within code gives the programmer more control over when properties are changed.
Changing Properties at run-time
The structure of a basic statement is:
object.property = value
This changes the property of the specified object to the desired value.
eg:
txtGreeting.text = “Hello”
This sets the text box’s text property to “Hello” – ie: displays “Hello” in the text box.To test the value of a property in a condition, the same structure should be used.
If txtGreeting.text = “Hello” thentxtGreeting.text = “Hi”ElsetxtGreeting.text = “Bye”End if
This changes the contents of the text box depending on the current contents.
Page 1 of 3
Add a Comment