Tuesday, December 28, 2010

Control Object Dasar

Control Object Basic(visual basic 6.0 Beginners)

A basic understanding of Visual Basic cans be started from the introduction of:

   1. Object
   2. Properties
   3. Event
   4. Methode

1. Object
Objects can be defined to an object in this case let's say the object there is textbox, labels and comman button.

2. Properties
Properties is something that belongs to the object.
Ex: textbox has a text property or property name

3. Event
Event is an event of the object at any given moment.
For example: Object command button to receive the event when the user clicks on the software we'll click on it.

4. Method
Method is something that can be done by the object.
For example: Object combo to add item names of the days on her with AddItem method
For example: combo1.AddItem "Monday"

Try with an easy first.
For example the use textbox, command button and label.
textbox, command button and the label actually have a lot of methods and properties. You also do not need to learn all the methods, events and properties that exist will only make you confused.

Try to learn the essentials event just as keypress events and click events over the course of time you will be familiar with the other events.

Studying the properties.

For the initial stage you just learned his property name and value it like for you simply use the textbox name and text properties (eg txtNama.text = "Budi"). txtNama = property its name.


Try to note the image above the cursor always shows its context. My point here is that if you point your mouse to click once objext automatic textbox properties window in the bottom right shows the property-property that textboxt object. Similarly with other objects.

  Using this context will greatly save your time in learning visual basic.

Place one label and one button Command1 on the form. Double-click Command1 and then type the code like below:


Private Sub Command1_Click()
    txtNama.Text = "Visual Basic"
End Sub

Then run the program by pressing the F5 key. After that click button Command1. Should the program runs like the image below:



Download project clik here

how to run the demo project:
1. extract the project file you've downloaded
2. open the file project1.vbp
3. Run the project by pressing the F5 key
4. click button Command1




                                                                                                                                                                                                                                                                                                                                                                                               

sumber:http://www.xbasicpro.com/

No comments:

Post a Comment