ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string control reset button (mac like)

Hi all,

 

Has anybody ever created a string input control that has an 'X' at the right corner to reset the values in the control. If yes, how to do? I do have plenty of filters for my data in my application and it would be sweet to have similar input reset button as with the most aple applications.

 

Thank u 🙂

0 Kudos
Message 1 of 11
(4,586 Views)

Hmm, an interesting idea.  Why couldn't you create a Cluster with two elements, String (a String, naturally) and Reset (a Latching Boolean).  I haven't tried making the appropriate Custom Control, but I can envision it ... .  I'm sure someone will give it a shot ... (maybe even I).

 

Bob Schor

0 Kudos
Message 2 of 11
(4,566 Views)

Hey, it works!  It was even easier than I thought it would be -- it's just a cluster, with some appropriate sizing and arranging the elements (Auto-sizing) horizontally.  I'm attaching the control -- feel free to play with it.  

Mac String.png

Bob Schor

0 Kudos
Message 3 of 11
(4,557 Views)

Cool! Thank you! 🙂

0 Kudos
Message 4 of 11
(4,531 Views)
Depending upon how ambitious you feel, this would also make an interesting XControl.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 11
(4,515 Views)
Well I have to admit that I have like no clue of xcontrols. How would that work?
0 Kudos
Message 6 of 11
(4,490 Views)

Have a look at this tutorial for XControls:

Creating New Front Panel Objects with LabVIEW XControls - National Instruments
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2jVCAQ&l=en-US

 

It explains it pretty nicely. There is also a LabVIEW Example that you can use as a starting point.

Refer to the Simple Dual Mode Thermometer XControl project in the labview\examples\Controls and Indicators\XControls\Dual Mode Thermometer directory.

Corinne Doppmann
Application Engineer
National Instruments
0 Kudos
Message 7 of 11
(4,474 Views)

Hi all,

Thanks for your input. At the same time you recommended to so solve this task with xcontrols, I attended the lv adavnced architecture training and xcontrols are part of it. here's the solution:

 

Thank you all!

0 Kudos
Message 8 of 11
(4,411 Views)

hi again,

 

the xcontrol I posted some time ago works like a charm, except the key focus. This seems to be an issue with any type of xcontrol that you cannot set the focus via the application anymore. I had the idea of a workaround to use methods, but I didn't got it to work. Any suggestions how to set the key focus of a xcontrol?

 

Thanks all!

0 Kudos
Message 9 of 11
(4,056 Views)

What have you tried? I would be very surprised if the application key focus property worked. My expectation would be that it would give focus to the XControl as a whole, not controls within it.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 11
(4,044 Views)