Problem with TabControl - dynamic tab pages

Answered
0
0

Hi – in my project I need to dynamically create tab pages in a tab control.

Adding them dynamically works beautifully.  However what I have noticed is that once you add them – the content area / client area of the tab that is shown is the last tab page added, and the “selected” tab is usually the first page added.  And once that happens you can’t seem to reconcile it with code.  The user has to click on the tab whose content is showing, and then other tab page clicks start to work as expected.

That may be a convoluted explanation.  Please see the attached project sample, and follow these steps.

Steps

  1. Click “Tab Config 1” or “Tab Config 2” button.
  2. Tabs are dynamically cleared and then added.
  3. Observe the results
  • Expected result – the tab page that is highlighted should be the same tab content shown.
  • Actual result – the last tab page’s content is shown and the first tab page is highlighted.

 

After that – according to my understanding of the methods I have coded – the buttons “Select Top Tab” and “Select Bottom Tab” should do as they are named. However – they do not.  It seems the tabs and their associated content are out of sync.  The situation seems to correct if the user first clicks the tab whose content is actually displayed (which is usually the bottom tab) – then after that further tab clicks are respected.

Am I doing something wrong – or is there a different way to use the methods?  I have tried .SelectTab, .SelectedTab, and .SelectedIndex – and all combinations thereof.

Any help would be greatly appreciated – and thanks in advance.

 

Attachment
  • You must to post comments
Best Answer
0
0

Thanks Matthew,

there have been quite a lot of fixes and enhancements since 1.3.44. Also to the tab control.

So if you find some time, I´d be glad to hear your feedback on a more recent build.

Best regards
Frank

  • You must to post comments
1
0

Hi Frank – just to follow up on this – I did take the time to update to version 1.4.31 and can confirm that the issue I was having with dynamically created tabs is completely fixed.

Thanks so much for putting out a great product and doing a great job at support and maintenance.

 

Thanks,

Matthew

  • You must to post comments
0
0

Hi Frank – thanks for the response and help. I do have an older version (I’ve been delaying updating as I also need to fix issues and deploy another project and have been trying to avoid a general regression testing of the other project – but perhaps its time to bite the bullet on that).

I have 1.3.44.0.  Were there updates to TabControl along the way?

Thanks,

 

Matthew

  • You must to post comments
0
0

Hi Matthew,

thanks your report and sample.
I have tested with the latest Wisej code base and could not reproduce the problems that you have described.
Can you please tell me which Wisej version you are using ?

If you want to test with a prerelease, please contact me at frankATiceteagroup.com, so you can verify it yourself, too.

Best regards
Frank

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.