Command Buttons and focus/enabling problems

  • Thread starter Thread starter Rob
  • Start date Start date
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
 
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.
 
Back
Top