LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

hide text fields when i select a button

I'm trying to setup a command button, that when clicked, will completely hide a set of text fields.  Currently, I have it set to dim the fields, but I want to try to hide them in order to save space on the gui.
 
Maybe I missed it when I was looking through the attribute and checking the examples, but if you could help me find which one, that would be great.
 
Thanks.
0 Kudos
Message 1 of 5
(3,579 Views)
Hi!

  In button callback function, you'll place a function like this:
 
         SetCtrlAttribute (panel, PANEL_TEXTMSG, ATTR_VISIBLE, 0);

where PANEL_TEXTMSG is your text message Constant Name (in uir editor), and 0 stands for hide;  1=visible.

Maybe is better to perform a ProcessDrawEvents() after setting the control attributes!

Hope it helps.

Anyway, it can be a bad practice to hide text messages to save space on front panel; depending on your application, you can use tabs or more panels.

Let me know if this helps!

graziano




Message 2 of 5
(3,578 Views)
Sorry, I was trying to hide a set of Numerics.  Basically, I have a button that will allow the user to select what fields he wants to enter.  By selecting the button, other options are available.  When the button is deselected, the options disappear.
0 Kudos
Message 3 of 5
(3,573 Views)
Hi Naveen654,

   it's the same thing! If you want to hide text, or numerics (controls) you can use the same function, you'll only have to put the right control ID.  I did this on a program where user had to select some DSP filter parameters, and depending on the filter type chosen, he could select the right parameters (numerics controls).

   I say again that in many cases, to perform control hiding you have to put a ProcessDrawEvents().

   Waiting for your answer!

   Bye!

graziano
Message 4 of 5
(3,559 Views)
Thanks.  It appeared to work as I wanted.  I appreciate the help.
0 Kudos
Message 5 of 5
(3,547 Views)