|
-
Mar 4th, 2003, 02:16 PM
#1
Thread Starter
Addicted Member
Keeping up with last textbox (RESOLVED)
I've searched the forums and haven't come up with anything...
I have a form with 5 textboxes and a control button for exiting by way of Form_QueryUnload. If the exit is cancelled, what is the best way to return to the last textbox that had focus?
I was thinking about assigning a variable to keep up with this when the textbox loses focus, but thought there might be a simpler way.
Last edited by GSIV; Mar 4th, 2003 at 09:15 PM.
-
Mar 4th, 2003, 06:07 PM
#2
PowerPoster
Well
Variable is the easiest way to accomplish...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Mar 4th, 2003, 06:26 PM
#3
Need-a-life Member
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
MsgBox Me.ActiveControl.Name
End Sub
But it will only work as long as you don't have a command that unloads the form. If you have one... the last ActiveControl would be this command.
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 4th, 2003, 09:15 PM
#4
Thread Starter
Addicted Member
Thanks guys!
Wow, what a quick response.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|