02-20-2006 03:15 AM
02-20-2006 06:41 AM
How are controls put on your tabs, during development, or progamatically at run time?
What version CVI are you using (really what I'm asking is are you using the new Tab control, or EasyTab)?
If you are putting the content on the tab programmatically, the classic mistake is to SetCtrl...(panel, control, .....), where panel is "A" and control is really on panel "B", but "A" has a control with the same #defined value, so it doesn't complain (in my opinion, this is NI's fault for having duplicate ID's). Also, with new tab control you have to retrieve the panel handle, but if you aren't careful you could retrieve the wrong panel, so double check that too.
It sounds like you are using the new tab control and statically placing the control, so this may not help.
02-20-2006 09:03 AM
02-20-2006 09:14 AM - edited 02-20-2006 09:14 AM
Hello Phil and Bilal,
I am using the new Tab control in CVI8.0. I see the behaviour when I change the tab page programmatically (I do this when the tabs are hidden), but also when I change it manually by clicking the tabs. I can see the behaviour both in the UI editor and at runtime...
I can post mu UIR file, but I'm not allowed to post any code, sorry.
Thanks for your help,
Wim
Message Edited by Wim S on 02-20-2006 04:15 PM
02-21-2006 09:21 AM
02-21-2006 09:30 AM
02-22-2006 02:38 AM
Hello,
I found out some more information about the problem. The tab control is created in my UIR file, but it only has 1 tab page. Other tab pages are created at runtime by copying the first tab page, using the CopyTabPage function. Appearantly, this causes the last added tab page contents to be visible, while another tab page is active. It seems to me that when a tab page is created, it has to be active once, before things work like they should. So I created a workaround by storing the currently active tab page in a variable, then creating the new tab page, using CopyTabPage. After that I make the new tab page active, using SetActiveTabPage. The last step is restoring the original active tab page. This seems to work fine.
02-22-2006 08:50 AM