From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

how open tab control, by click on an object?

Solved!
Go to solution

tnx a lot Zwired1

yes, actually i want use a button with invisible color on the tank. and then, when I click on the tank, actually I click on the button and invisible tab control will be visible. are you sure, it is possible to invisible color? i checked it but I couldnt find any color by name invisible or colorless. could you? it seems simpler than "mouse down" event .

 

if it dosnt work, I would research more about "mouse down" event .

 

Best Regards

 
 

 
 
  
0 Kudos
Message 11 of 22
(1,771 Views)

Reeeeaaallllly don't need the transparent Boolean button on top of the tanks indicator. 

 

You're not saving yourself any time by trying to do things that you don't need and "if that doesn't work" read the help files.  We all need to learn that lesson now and then, I suppose.  

 

I reworked the VI to show tabs one or two if you click on tank one or two.   I also added tabs three and four and have them show when you move the mouse over tank three and four.  Look up "mouse enter" event if you like the way that works.

Message 12 of 22
(1,763 Views)

thank you Zwired1, yor suggestion is admirable and I will try to learn it more. but there is a problem: showing my water levels change depend on passing my mouse over it or click on the tank, while tank level should be update auto. isnt true?

0 Kudos
Message 13 of 22
(1,748 Views)

I don't quite understand your question. 

 

As it is now, the tank level is not set by any process. The "mouse down" or "mouse enter" event do nothing to change the tank level -- they only cause the tab indicator to change which tab is displayed.  

0 Kudos
Message 14 of 22
(1,731 Views)

I want visible a tab control by click on the object(like tank) and invisible that by click on the object too. I checked mouse events, it seems it not possible by that. and there is some limitaion like associate other object to mouse events . for example, I add control tank level by knob, but any change by knob apply after mouse change(mouse events).you said i can do invisible color of a switch ot button, why you are not compliant with?

0 Kudos
Message 15 of 22
(1,723 Views)

It is possible with mouse events but it takes just a little more logic.  Inside the mouse down event for tank 2, for instance, check to see if the incoming wire (also attached to the tab indicator terminal) is already equal to 1 (the tab associated with tank 2). If it is, set the out going wire to a blank tab, otherwise set it equal to 1.  

 

I'm opposed to creating transparent objects to do something that can already be done easily without them.  Add to that the fact that you're talking about many tanks, you'd end up with a lot of extra stuff you don't need.  That being said, what you're suggesting will work so go for it if you feel strongly.

 

 

0 Kudos
Message 16 of 22
(1,713 Views)

i couldnt do it. other friends have any more suggestion?

0 Kudos
Message 17 of 22
(1,662 Views)
Solution
Accepted by behzad1

I modified what I sent earlier.  Now if you click on any of the tank controls, it's associated page in the tab indicator shows.  If you click again, it goes away. 

 

Essentially, the logic is   "if the tab indicator is already showing the page associated with the tank that was clicked show a blank page (0), otherwise show the page associated with the tank."

 

I know I shouldn't add extras beyond the concept inherent in the post, but it just kills me to code four evnts with the same code except for a constant.  Instead, I used a trick (a property node and a string operation) to extract the number out of the tank control's label and used that to drive the tab indicator.  That way, if you add more tanks you only have to add them to the event already programmed rather than create another event case (assuming you keep the same naming scheme).

 

I also added a timeout -- after 10 sec the indicator will revert to a blank page. 

Message 18 of 22
(1,651 Views)

dear Zwired1

 

I really appriciated for your kindly help. it was really useful  but for achieving my goals it's need to be changed a little. so would you mind to explain the program in more detail?

In addition to understand each part role i need to find out the reason and detial of each used block.

 

Regard.

0 Kudos
Message 19 of 22
(1,633 Views)

Here are the concepts used in the VI: 

   while loop

   shift register

   event structure

   use default if unwired

   control reference

   property node

   scan from string

 

Please search the help files (the above list would make good search terms to start) and post a concise question if you're still fuzzy. 

 

0 Kudos
Message 20 of 22
(1,604 Views)