From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Button Caption Question

All - I need some ideas or perhaps what I am asking for is not possible.

 

I have created several buttons that use the button caption property to display the identification numbers of samples that our employees must measure. If I click on any of the buttons where the caption property exists, nothing happens. Looking at the Event Structures Add/Edit Events dialog box, it appears that there isn't an event for this.

 

Is there a way that if I or another user happens to click the area of the button where the button caption overlaps it, it would trigger an event?

0 Kudos
Message 1 of 8
(2,178 Views)

Use the "boolean text" instead.

 

(EDIT: you are already using it for the ? it seems. Can you show the code what and how you are changing things?)

0 Kudos
Message 2 of 8
(2,170 Views)

I would do like altenbach said and use the boolean text. However, if you really need to do it this way you could always put a transparent button on top of this one and use it to trigger your event structure.

0 Kudos
Message 3 of 8
(2,154 Views)

Hooovahh's example a while back is how I am changing the display in the boolean text field/area. The Caption Text never changes. That is where the ID is displayed.

 

I could do the transparent button idea but then it would be a PITA to coordinate what transparent button goes with the non-transparent button.

 

This is  not something detrimental but if there was an easy fix, I wondered if someone had an example ir had a simple idea. This is more likely just a training issue.

0 Kudos
Message 4 of 8
(2,133 Views)

Customize the button, hide the caption under the existing translucent white layer.

Then the caption won't block clicks.

See attached VI.  I customize the first button.

 

George Zou
Message 5 of 8
(2,128 Views)

I don't get it!  There should be No Problem!  I just created a Push Button Control (LabVIEW 2018), gave it the Label "Push", gave it the Caption "Button", and made only the Caption visible on the Front Panel.

 

On the Block Diagram, the Control was named "Push" (the Label).  I created an Event Structure and chose "Edit Events Handled by this Case", chose Value Change, and it showed me the Control named "Push" (not "Button").  I ran the program, push the Button showing the caption Button, and the Event fired.

 

So the Caption is ignored, the Label is used, and you don't need to do anything special just because you hide the Label, use a different Caption (shown or not), no muss, no fuss.

 

Bob Schor

0 Kudos
Message 6 of 8
(2,120 Views)

If you put the caption on the button, when you click on the caption, event won't fire.

 

George Zou
0 Kudos
Message 7 of 8
(2,113 Views)

@zou wrote:

If you put the caption on the button, when you click on the caption, event won't fire.


Big deal!  If you leave the label on the button, when you click on the label, the event won't fire.  To make the Event fire (in both cases), you need to click on the button!  I remember learning this with LabVIEW 7.0, and I just tested it with LabVIEW 2018 and it still behaves the same way (at least for the button on the Modern Palette called "Push Button" ...).

 

Bob Schor

0 Kudos
Message 8 of 8
(2,093 Views)