Return to the object that you came from.

  • Thread starter Thread starter Rob Bradford
  • Start date Start date
R

Rob Bradford

All.

I would like to return to the object I left immediatly prior to moving
to the exit button, should the user choose not to confirm his/her
exit.

Is this possible, if so how?

Rob.B
 
Hi Rob,

This is from the top of my head... and there can be better solutions - but
here is one.

Take a form level member variable of type control
Private m_LastSelectedCtrl As Control

Then in each textboxes or whatever controls you want the focus to transfer
to in there Leave event make it last selected ctrl
like in Button1_Leave
m_LastSelectedCtrl = Button1

Then finally incase user doesnt want to exit check for the last selected
control and if any select it
If Not m_LastSelectedCtrl Is Nothing Then m_LastSelectedCtrl.Select()

HTH
rawCoder
 
Thanks to everyone who replied, although it took a while for me to get
my head around some of it, found it all to be a great help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top