Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

event GotFocus

hi,
How do i access the event 'GotFocus' in VB 6.0?
Thanks
[86 byte] By [deena2209] at [2007-11-11 9:58:11]
# 1 Re: event GotFocus
In the top of your IDE [In the Code view] , there is two combo boxes .. the left one contains controls name , functions and the right one contains all subevents ..

for example to access the event "GotFocus" from the control "Combo1" :
In the left choose your "Combo1" and then from right "GotFocus"

Write cooding for this could be "Private Sub Combo1_GotFocus()" but preferable to let the IDE generate it because some problems of missing parammeters ..
Amahdy at 2007-11-11 17:23:25 >
# 2 Re: event GotFocus
From the code window, you select the control from the drop down list on the left and then select the GotFocus event from the drop down list on the right. This will create the GotFocus event subroutine where you would then insert your code. Be forwarned that whatever the default event for that control, usually the click event, will get it's event sub created automatically when you select the control from the list on the left.
After you select the GotFocus event from the list on the right you should go back and delete the empty event sub for the default event. If you already have code in the controls default event then it won't create another one, it will just take you to that code. Which is great because then you don't have to go back later and delete the empty sub.
Ron Weller at 2007-11-11 17:24:27 >