Undo not available question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good Morning All,

I am using the Undo command as a cancel button on a form. Is there a way
to disable the command button, if the undo is currently not available?

Thanks,
Renee
 
Renee said:
Good Morning All,

I am using the Undo command as a cancel button on a form. Is there
a way to disable the command button, if the undo is currently not
available?

Thanks,
Renee

I expect you could set the button's Enabled property to False in the
form's Current event, and then set it to True on the form's Dirty event.
 
Try enabling the button in the form's Dirty event. In the code in the
button's click event, you can disable the button again after you do the
Undo, but since you click the button it will have the focus and you can't
disable an item that has the focus. The trick is to move the focus to
another control first, then disable the button.
 

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