doraemon Posted March 12, 2004 Posted March 12, 2004 In VB.Net I noticed that the leave event for my textbox is firing up twice. On most occassions it would not matter but on some situations when I had to do some cumulative calculations the results would be wrong. It seems to be running okay using the lostfocus event, but when I was taking VB .Net training, it was recommended to use the leave event because that's a .Net framework event where as lostfocus is a VB 6 event. Please advise. Quote
pas30339 Posted March 14, 2004 Posted March 14, 2004 Describe the scenario. Are you exiting the form when you leave the textbox? I'm thinking the Leave event is being raised at the textbox level and then the form level. You may also want to consider using the Validating event rather than the Leave event. Quote
doraemon Posted March 16, 2004 Author Posted March 16, 2004 I am just trying to leave the textbox and move to the next one on the form and not closing the form. I don't know if it matters if the tab order would matter. With the tab orders, the immediate next control is a label, but that should not matter, right? Describe the scenario. Are you exiting the form when you leave the textbox? I'm thinking the Leave event is being raised at the textbox level and then the form level. You may also want to consider using the Validating event rather than the Leave event. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.