LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Double click on the image on front panel

Hello, I was wondering if some one can help me to do this. I want to place a small image / picture on front panel. And if i double click on that image it should open a dialogue box or a sub vi.

 

thanks in advance,

Sulekha.

0 Kudos
Message 1 of 10
(2,893 Views)

You can use the Mouse Down? event for the picture indicator.  Then you can read the Mods terminal that shows up inside on the left hand side of the event case to see if a double click has occurred.

0 Kudos
Message 2 of 10
(2,886 Views)

Ravens do you have any link that explains the theory, how to deal with the image on front panels. I did a search in the forum but couldnt find any luck. If you have any can you please post it.

0 Kudos
Message 3 of 10
(2,873 Views)

Ravens I dont see any indicator on the block diagram when i place a picture on the front panel.

0 Kudos
Message 4 of 10
(2,870 Views)

You need to place a "2d picture control" right-click and change to indicator. You cant just copy and paste any ol' bitmap onto your front panel and expect a picture indicator to show up.

 

 

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

Thanks, Imstuck.  Excellent image.

 

I guess there is one other way to do it if the poster doesn't want a picture control or indicator on the front panel, but just has an image dropped on it as a decoration.  That would be to do a Mouse Down? event on the VI's pane, and compare the coordinate's of the mouse with some coordinates that define the location of the image.

 

But it would be a lot easier to just have the picture be an actual picture indicator or control.

0 Kudos
Message 6 of 10
(2,843 Views)

Thank you Ravens and Imstuck for the explanation. I created a vi with out 2-D picture control logic. This is opening the sub vi when i double click it during run time. But is there any way to open the sub vi or an dialogue box by double clicking the image with out actually running the vi.

 

Sulekha.

Download All
0 Kudos
Message 7 of 10
(2,836 Views)

@sulekha wrote:

But is there any way to open the sub vi or an dialogue box by double clicking the image with out actually running the vi.

 

Sulekha.


No, because a VI has to be running in order for the code inside of it to be able to execute. Smiley Wink

 

Why would your main VI not be running?

0 Kudos
Message 8 of 10
(2,830 Views)

My Main should not be running because I want to do some thing like this:

 

I want to hide a path control in a dialouge box. Where user clicks a image on the front panel, which opens a box containing path, so that he can feed a text file, which is used by some other part of my main program.

 thank you.

0 Kudos
Message 9 of 10
(2,825 Views)

At what point of time do you ever get your Main VI running?  What do you want your Main VI to do once you actually start it running?

 

Perhaps it just a matter of having your Main VI running but just idling in a while loop waiting for something else to happen before you get to the meat of your program that will occur in the main VI.

 

One other possible way, and I'm not really sure if this can be done since I have no experience with them, is to use an Xcontrol.  These are special controls you create that have some background code you can execute.

 

But before I can really recommend you use Xcontrols (assuming they can do what I am thinking), is that you truly define what your program's architecture is going to be as it seems to not be very defined right now.

0 Kudos
Message 10 of 10
(2,818 Views)