MouseDown event on a combo

A

Ashu

I have a form to display projects for a list of client. Client is shown as
combo box. The user can add new projects or change existing projects in that
form.

I want a warning message to be displayed when the user tries to change the
client for an existing project and then the user can decide whether he wants
to change the client or not. I have done this by adding code to the MouseDown
event of that combo for Client. But the prob is the warning message gets
displayed twice once when the user clicks on that combo and again when he
selects some new value for the client, how can I avoid displaying this
message twice or is there a better way to do it?

Thanks,
 
K

Ken Snell [MVP]

Don't use the MouseDown event. Use the BeforeUpdate event to ask the user to
confirm the change. If the user says "don't change", you can cancel the
event by setting the Cancel integer variable to True.
 
B

Bas Cost Budde

Ken said:
Don't use the MouseDown event. Use the BeforeUpdate event to ask the user to
confirm the change. If the user says "don't change", you can cancel the
event by setting the Cancel integer variable to True.

As user interface consultant I recommend you do not take action that a
user might want to cancel on mouse (button, key) down. The better way is
to do so only on mouse (&) up. The user may then back out of a sequence
by moving the mouse off the item (s)he pressed.
 

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