LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab page is showing the wrong content

Hello,
 
My User Interface has a tab with 6 pages. When I start my program, the first tab page is active, but the contents of the 6th tab page is shown. If I click on one of the other tab pages, the contents remain the same. When I click on the 6th tab page and then on another tab page, the tab page content is correct and the problem is gone, until the next time I start my program.
 
Has anyone seen this behaviour before?
 
I also sometimes have this problem when I am editing my UIR file: a tab page is showing the wrong contents until I click on the page to which the content belongs. This sometimes happens with all tab controls in my User Interface... Smiley Sad
0 Kudos
Message 1 of 8
(4,248 Views)

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.

-Phil
just some hack.
0 Kudos
Message 2 of 8
(4,237 Views)
Hello Wim

Is this behavior you are seeing at runtime or in the UI editor? Could you post a sample I could use to replicate the issue on my machine?

Thanks

Bilal Durrani
NI
0 Kudos
Message 3 of 8
(4,233 Views)

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

0 Kudos
Message 4 of 8
(4,227 Views)
I can see the problem in the UI editor, but not at runtime. Is there something sepcific you have to do to see the problem at runtime? Or is just a call to LoadPanel sufficient?

Bilal Durrani
NI
Message 5 of 8
(4,174 Views)
I just started using the new Tab control a few weeks ago.  I never saw this problem until you mentioned it.  Now I notice that the last tab page comes up on other tabs, sometimes.   If I click on the last tab, then another tab, the correct content is displayed.
 
One last hint as to where the CVI bug is ...  It only happens when the .UIR file is displayed during CVI startup.  If the .UIR is not in the foreground when CVI comes up, and I click on it to bring it forward, the tab content is correct.
 
I never see a problem (yet), in runtime.
 
Phil
Message 6 of 8
(4,176 Views)

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.

Since I am not allowed to share my code, I created a small project to make things clear. I attached it to this message.
 
Thanks for all support, I really appreciate it Smiley Wink
 
Wim
0 Kudos
Message 7 of 8
(4,144 Views)
Thanks for reporting this. I'll forward this information to the developers for further investigation.
Bilal Durrani
NI
0 Kudos
Message 8 of 8
(4,132 Views)