Visual Basic 6 0 Properties Methods and Events
Visual Basic 6. 0 Properties, Methods and Events P. J. Balakumaran, A. P, SNMV CAS
• Textbox, Command buttons, etc. , are called as objects • objects are loaded with properties • Ex: - flower loaded with color, shape, etc… like objects P. J. Balakumaran, A. P, SNMV CAS
• Properties define the characteristics of an object such as Size, Color etc. , • Textbox Properties are – – – Enabled, Font, Multi. Line, Text, Visible, Width, etc. , Visual Basic 6. 0 P. J. Balakumaran, A. P, SNMV CAS
Method • A method is an action that can be performed on objects. Visual Basic 6. 0 • Object-oriented programming, a method is a connected or built-in procedure. Text 1. Move 700, 400 • It has other associated methods such as Refresh, Set. Focus, etc. P. J. Balakumaran, A. P, SNMV CAS
Simple logic • Properties describe objects. • Methods cause an object to do something. • Events are what happens when an object does something Alignment Left Visual Basic 6. 0 Objects Font. Bold Visual Basic 6. 0 Method P. J. Balakumaran, A. P, SNMV CAS Change or CLick Visual Basic 6. 0 Event
Common Properties PROPER TY DESCRIPTION Left The position of the left side of a control with respect to its container Top The position of the top of a control with respect to its container Height A control's height Width A control's width Name The string value used to refer to a control Enabled The Boolean (True/False) value that determines whether users can manipulate the control Visible The Boolean (True/False) value that determines whether users P. J. Balakumaran, A. P, SNMV can see the control CAS
Common Methods P. J. Balakumaran, A. P, SNMV CAS
Common Events Event Occurrence Change The user modifies text in a combo box or text box. Click The user clicks the primary mouse button on an object. Dbl. Click The user double-clicks the primary mouse button on an object. Drag. Drop The user drags an object to another location. Drag. Over The user drags an object over another control. Got. Focus An object receives focus. Key. Down The user presses a keyboard key while an object has focus. Key. Press Key. Up The user presses and releases a keyboard key while an object has focus. The user releases a keyboard key while an object has focus. Event Occurrence Lost. Focus An object loses focus. Mouse. Down The user presses any mouse button while the mouse pointer is over an object. Mouse. Move The user moves the mouse pointer over an object. Mouse. Up The user releases any mouse button while the mouse pointer is over an P. J. Balakumaran, A. P, SNMV object. CAS
- Slides: 8