Tuhero
01-28-2004, 09:18 AM
Hi.
In my app I have set some action to happen, when txtbox looses focus. I works just like it should when using mouse or tab to change focus to another button, or box.. but when I use shortcut key... for example I have Update button, and I have set shortcut key alt+U for that. Now when used, button goes down ok, but it seems like txtbox looses focus without lostfocus() event happening..
Focus goes to the button... but thereīs something wrong, because it doesnt do things it should do in lostfocus.
So.. my question is.. does lostfocus() event happen differently when focus is lost by pressin alt+key... ?
cmeares
01-28-2004, 09:54 AM
Hi.
In my app I have set some action to happen, when txtbox looses focus. I works just like it should when using mouse or tab to change focus to another button, or box.. but when I use shortcut key... for example I have Update button, and I have set shortcut key alt+U for that. Now when used, button goes down ok, but it seems like txtbox looses focus without lostfocus() event happening..
Focus goes to the button... but thereīs something wrong, because it doesnt do things it should do in lostfocus.
So.. my question is.. does lostfocus() event happen differently when focus is lost by pressin alt+key... ?
I'm not an expert on the matter but I don't think that it would, because a lostfocus works the same by clicking somewhere else or tabbing somewhere else. Have you tested putting just a message box in the lost focus event?
Agent707
01-28-2004, 09:59 AM
How did you set the shortcut key to your command button? Set it's caption to "&Update"?
That should not prevent your lostfocus even from firing. Hmmm...
Oh, and to answer this: "So.. my question is.. does lostfocus() event happen differently when focus is lost by pressin alt+key... ?"
Yes, the lostfocus on the text box event still fires when you use a shortcut using Alt+key to another control. er... at least it does on my computer.
Tuhero
01-28-2004, 11:07 AM
How did you set the shortcut key to your command button? Set it's caption to "&Update"?
That should not prevent your lostfocus even from firing. Hmmm...
Oh, and to answer this: "So.. my question is.. does lostfocus() event happen differently when focus is lost by pressin alt+key... ?"
Yes, the lostfocus on the text box event still fires when you use a shortcut using Alt+key to another control. er... at least it does on my computer.
Thanks to both of you.. I have set my shortcut that " &Update" way...
when I tested with msgbox.. it actually goes to lostfocus... so... I just have to find out why it doesnīt do what itīs supposed to do.