Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Got_Focus, Lost_Focus Event
Message
De
07/08/2001 14:05:59
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Got_Focus, Lost_Focus Event
Divers
Thread ID:
00540838
Message ID:
00540838
Vues:
47
Hey There -

I'm having a problem with code firing at unexpected times.

I have a form that is populated. There is a button that will restart the form - basically clear out all of the information. If I just let the code run either full compiled or not I get an error message because of code setting focus to an object. The code is running a procedure calling setfocus that it does NOT call if I step through the code.

1) How is this possible? I can take the same exact steps and if I let the code just run I get an error, but if I step through the code I do not get the error.

2) In the extra code that is being run: There are two textboxes next to each other text1, text2. text1 loses focus, text2 gets and loses focus: the code is

Private Sub Text1_Lost_Focus()
text1.backcolor = FOCUS_BACKCOLOR
End Sub

Private Sub Text2_Got_Focus()
text2.backcolor = NO_BACKCOLOR
End Sub

Private Sub Text2_Lost_Focus()
text2.backcolor = FOCUS_BACKCOLOR
End Sub

What is causing the code to run the got_focus, lost_focus of text2? I am not resetting focus to another object.

3) Does anybody know where I can find a white paper that says the order events are fired (and the cause) for objects other then Form?

I'm not sure if I explained my problem very well. Let me know if I can explain something better!

Thanks,

Nichole
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform