07-30-2013 01:40 AM
Hello,
I have a tab control and I want to have a close tab button on each tab. Exactly like the below figure. How do I do this? Since tab is not allowing me to customize with additional controls.
07-30-2013 04:42 AM
There is no way of editing the actual tab control at run-time, so you can't actually close a tab. But you can hide it. This code hides the current tab:
07-30-2013 05:01 AM
Well what I meant was on clicking the close button it should remove the tab. My original issue was with front end. I mean how can I have a button on the tab which would remove the tab?
07-30-2013 06:28 AM
@JarleEkanger: Could you also explain me step wise how did you achieve the code you have pasted. Since I am not able to get page property from tab control.
07-30-2013 06:47 AM
You can start with the attached code (or may be just extract the idea/concept and write your own code...)
Well there are couple of bugs... and I don't have time to fix it now...!!
07-30-2013 06:49 AM
from left:
1 - this is a refnum constant that refers to the tab control.
2 - property node; once the refnum is wired in you should be able to find a "Pages" entry in the property list, just below the middle of the list. this property returns an array of refnum for each individual tab page.
3 - the "format into string" function from the strings pallette converts the tab control value to a string representing the name of the current tab.
4 - the for loop iterates through each of the page refnum in the array. when you wire the refnum to a property node, you get the "Page" property node, which has properties such as tab caption etc.
5 - it's the same thing in the case structure.
you find the "empty" property node on the block diagram pallette -> Application ... -> "Property Node"
07-31-2013 06:37 AM
@moderator1983: Well I knew that I can use a Boolean button on tab. But was hoping a different answer. :)....
I am sure everyone would like to have a close button on tab and I am also sure someone would have suggested this to the NI guys. I am just wondering why is it not implemented yet?
07-31-2013 02:34 PM
I can't test it right now, but doesn't the tab control support symbols? If so you can capture a "Mouse Down" event on the tab control, and then use the coordinates to possibly detect if the symbol was clicked. The event it self may even tell you if the mouse is over the symbol.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord