Having trouble with a masked textbox

EStallworth

Well-known member
Joined
Aug 14, 2006
Messages
75
Location
Destin, FL
Programming Experience
Beginner
I have an application that uses the datediff of two textboxes. I changed those textboxes to masked textboxes and gave the masked txtbxs the exact same name as the old txtbxs. Now my datediff does not work (is not recognizing the user input or assigning it to my variables). Can anyone tell me why?¿
 
Sorry guys false alarm. I had to add Handles txtbox.lostfocus to the end of the declaration of the sub. DOH!:eek:
 
Don't use the LostFocus event at all except in the very specific circumstances specified in the help topic for that event. Under almost all circumstances you should use the Leave event. The same goes for GotFocus and Enter.
 
Don't use the LostFocus event at all except in the very specific circumstances specified in the help topic for that event. Under almost all circumstances you should use the Leave event. The same goes for GotFocus and Enter.

Does using the lost and got focus events cause functionality problems that I am not aware of?¿ I have not read the help topic, but it seems as if I need to. Thx.
 
GetFocus and LostFocus are intended for very specific use. They will not behave exactly as you expect in all situations. I'm not aware of al the specifics but I am aware of cases of people using those events and having issues and when they switched to Enter and Leave the issues were resolved. I guess it depends exactly what you're trying to do.
 
With that being said, I just changed all my events from lost/got focus to leave/enter. Thx.
 
Back
Top