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.
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.
05-10-2019 12:55 PM
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?
05-10-2019 01:08 PM - edited 05-10-2019 01:11 PM
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?)
05-10-2019 01:47 PM
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.
05-10-2019 03:46 PM
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.
05-10-2019 04:15 PM - edited 05-10-2019 04:16 PM
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.
05-10-2019 04:26 PM
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
05-10-2019 04:37 PM
If you put the caption on the button, when you click on the caption, event won't fire.
05-10-2019 09:08 PM
@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