Jump to content

Can I use a picture as a button?


Kalle

Recommended Posts

I just want to make the GUI better on my VI.

And I realy want to use pictures innsted of normal "square" buttons from labview.

Is this possible?

Kalle

(sorry my language..)

You can customize a boolean control to have an image by right clicking it and selecting Advanced>Customize. You should read the LV help and user manual about how to customize controls.

Another option is to use a combination of a picture control and mouse down events, so you can even change your pictures.

A third option is using a picture ring, which allows you to hold several images. You can disable the control and detect the mouse down event for it to know when it was clicked.

Link to comment
You can customize a boolean control to have an image by right clicking it and selecting Advanced>Customize. You should read the LV help and user manual about how to customize controls.

Another option is to use a combination of a picture control and mouse down events, so you can even change your pictures.

A third option is using a picture ring, which allows you to hold several images. You can disable the control and detect the mouse down event for it to know when it was clicked.

Another "quick and dirty" method I've used in the past is to place a picture on the front panel, then to put a "rectangular" button over it (matching the picture's height and width) and then give the button a transparent color - at least when in the default state. I've attached an example, which has a subtle change to the above instructions such that I make the non-default state a color of red, and changed the "mechanical action" to be "latch when released". This causes the button to flash red briefly before it goes back to its default "transparent" value.

Most important for this to work! The picture MUST be behind the "transparent" boolean control, not in front of it. Otherwise, at run time the picture will block the user from pressing the boolean!

-Pete Liiva

Download File:post-2931-1129051239.vi

Link to comment

Of course, you can also use an event structure that detects when you click on a picture control and use that instead of a boolean. Slightly more work, lots more flexibility.

Seems I recall that the LabVIEW GUI book had a nifty example code in it that replicated the functionality of the Outlook sidebar using the picture control and lots of setup options for the "buttons" that were loaded at startup from picture files.

Link to comment
  • 2 years later...

Hello,

I've been looking for a way to replace le "Caption" of a button by an Icon/Picture, in a "Toolbar" fashion.

The methods proposed in this topic are quite ugly (although doable).

Is it really possible that LabView doesn't support natively this feature when their own interface is full of it?

In the "Toolbar Using Splitter.vi" example they seem to implement it quite nicely but I have no idea how to make something like that.

Any info is welcome

Cheers !

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.