Need advice on events

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
 
M

Michael C

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.
 
R

RobinS

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.
 

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