LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to simulate a mouse click ?

Hello,

I look for a way to simulate a mouse click on a control (color numeric).

Has anybody an idea?

0 Kudos
Message 1 of 10
(5,668 Views)

Hello Domp,

 

Does this post help?

 

Best regards,

= Nelu F. || National Instruments.

0 Kudos
Message 2 of 10
(5,661 Views)

Hello,

 

1) I don't know how to simulate a mouse click.

2) What do you mean by simulate, do you want to have a mouse event in your callback routine (possible) or do you want the color numeric to change its color? The latter you can achieve also using the keyboard, so in this case you could 'replace/simulate' a mouse with the keyboard

0 Kudos
Message 3 of 10
(5,660 Views)

Thanks for all of you.

In fact I need to put a color numeric in a table but it seems to be impossible. So, I have made a new panel whith only a numeric control. When I  clic in a certain cell of my table , I load this small panel at the position where I've clicked but I would like my color numeric to be programmatically open like by clicking on it.

I hope it's clear...

0 Kudos
Message 4 of 10
(5,653 Views)

Hello Domp,

 

I think you can call the code that loads the small panel from wherever you want. You don't have to simulate a click, you can call the code or function that loads the panel instead.

Does that make sense? If not, maybe attaching a project would help us determine exactly the situation you're into.

 

Best regards,

= Nelu F. || National Instruments.

0 Kudos
Message 5 of 10
(5,638 Views)

Hello Neluf,

Yes I know I can call the code that loads panel wherever I want. But if  I want to simulate a click it's to expand the color numeric control placed in this this panel whithout having to click on it. By this way, the user must have the impression to click directly on a color numeric like if it was a natural part of the table.

You could see what I mean whith this screenshot. (The black control is my table).

Best regards.

 

 

0 Kudos
Message 6 of 10
(5,633 Views)

In that case, wouldn't Wolfgang's post help?

0 Kudos
Message 7 of 10
(5,629 Views)

No sorry, every help is welcome.

0 Kudos
Message 8 of 10
(5,621 Views)

Basically the solution is to fake a space press on the color numeric, which opens the color map section of the control.

 

I was just making up a small example on how to do this while I realized that an example shipped with CVI does exactly what you are trying to do: take a look at gridview example in <cvidir>\samples\userint folder on your disk. If you cannot locate it you can find it here. The trick is used in ColorMapCB () callback.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 9 of 10
(5,604 Views)
Thank you Robberto and thank you to all those who have spent time for me but I found the solution to my problem. I have used a Windows API function : "mouse_event" and now every thing works fine. Best regards
0 Kudos
Message 10 of 10
(5,594 Views)