vbdavie Posted August 27, 2015 Share Posted August 27, 2015 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? Thanks Davie Quote Link to comment Share on other sites More sharing options...
bugra Posted August 28, 2015 Share Posted August 28, 2015 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. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 28, 2015 Administrators Share Posted August 28, 2015 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? Isn't it the way VCL works? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 28, 2015 Administrators Share Posted August 28, 2015 Well, you can keep the active tab unchanged by explicitly setting it as active. Quote Link to comment Share on other sites More sharing options...
vbdavie Posted August 28, 2015 Author Share Posted August 28, 2015 That's what I ended up doing. Thanks Davie Quote Link to comment Share on other sites More sharing options...
vbdavie Posted August 28, 2015 Author Share Posted August 28, 2015 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. Davie Quote Link to comment Share on other sites More sharing options...
vbdavie Posted August 28, 2015 Author Share Posted August 28, 2015 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 DAvie Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.