Jump to content

PageControl/TabSheet - TabIndex issue


Recommended Posts

When I use the PageControl with 3 tabsheets, I end up with a problem. I start with all three tabs VISIBLE. And depending on the login credentials from my login screen, I will remove a tab. So, I set tabsheet3.tabvisible to false.


Basically my code sets the tabsheet3 to false no matter what, THEN if they appear like a super user, I set the tabvisible to TRUE. The dissappointing thing is that now the CURRENT ACTIVE tab then becomes tabsheet 3.


Is the active tab supposed to CHANGE? I had tabsheet 1 set as the active, and then I set the tabvisible on TS3 to false and then set the tabvisible on TS3 to true and then POOF, my actiive TS is now TS3. Huh.


Is it supposed to work this way? Is there a way to make these controls behave as close as possible to the way the VCL works?





Link to comment
Share on other sites

which unigui version you are using?  It shouldn't behave like that. can you try this.


-open new project add pagecontrol and a button

-add three tab in pagecontrol and make third one closable true.

-in button click event add this code

UniButton1.Caption := UniPageControl1.ActivePage.Caption;
  UniTabSheet3.TabVisible := not UniTabSheet3.TabVisible;

if active page doesn't change (as it's supposed to be) there is a problem in your code, if it's change there is a problem in unigui version you use. if that is the problem try latest version.

Link to comment
Share on other sites

Farshad, the VCL that I use does NOT work that way. It works as expected. IE: When you have a TABVisible:=False and then TRUE, it does NOT change the active tab.


Bugra, the version I am using is version 99.50.1189


It's fairly recent.


Yet another difference that should be noted (in the VCL vs WebMode documentation), unless of course it gets fixed.



Link to comment
Share on other sites

Huh, I just went back to review the problem and it is GONE. It now works as expected. My only change was to DITCH the stringgrid in favor of the DBGrid. WIerd.


Let's pretend this never occured since now I can't reproduce it and my history folder only goes back to early in the morning and that version also worked.


So, case-closed :)



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...