Need advice on events

  • Thread starter Thread starter Bill Gower
  • Start date Start date
B

Bill Gower

I have 2 listboxes side by side where the user can move an item from left to
right or vice versa by double clicking the item or clicking on a button(s)
between the two listboxes. I want to enable to disable the move left or
move right buttons as determined by the number of items in the listbox.

Example. I have no items in the right hand list box so I don't want the
move left button to be enabled. As soon as an item is moved to the right
hand listbox then I would like the return button to be enabled. As the
MoveListItem can be called in several ways, I am trying to think of a clean
way to enable or disable without duplicating the code.

What is the best way to do this?


Bill
 
Bill Gower said:
I have 2 listboxes side by side where the user can move an item from left
to right or vice versa by double clicking the item or clicking on a
button(s) between the two listboxes. I want to enable to disable the move
left or move right buttons as determined by the number of items in the
listbox.

Example. I have no items in the right hand list box so I don't want the
move left button to be enabled. As soon as an item is moved to the right
hand listbox then I would like the return button to be enabled. As the
MoveListItem can be called in several ways, I am trying to think of a
clean way to enable or disable without duplicating the code.

What is the best way to do this?

Put the code in a function and call it from whereever is required.
 
Put it in the click event when you move from one listbox to the other.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
 
Back
Top