Command Buttons and focus/enabling problems

R

Rob

Hi all,

I have a list box that lists points of contact for a job. I have two
buttons that:
a. allow an addition to the list (I use a pop up form to choose who goes in
the list)
b. delete an existing contact from a list

After deleting a row in a list box, I want to be able to disable the button
that initiated that action. To delete the row I delete the data in the
underlying tables and then refresh the list box. Unfortunately as the button
still has focus I am unable to "disable" it.

As a work around I have shifted focus to the "add to list" button, then set
the enabled property to false for the "delete from list" button. Thing is
that this does not feel that elegant. Is there a much simpler way that I am
missing or is the practiced way of enabling this sort of functionality,

Cheers
Rob
 
V

Van T. Dinh

I normally have a dummy TextBox Control txtDummy for this purpose. Set the
Height and Width to 0, 0 and users won't be able to see it.
 

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

Top