How do I properly disable a tab in Page Control?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35571
    DarrenB
    Participant

    Hi,

    it might sound like a stupid question but I couldn't find a quick answer that worked!

    make a basic form with a skinmanager,skinprovider. PageControl with 3 tabs. Place a label in each…. captioned Tabsheet1, Tabsheet2 Tabsheet3.

    Disable TabSheet2 and Tabsheet3 in properties of Pagecontrol.

    Run Program. Tabsheet2 and Tabsheet3 appear in a disabled state but I can still click on their tabs and open pages…led to some horrible code executing here that shouldn't have as I do stuff in the Tabsheet OnShow event to prepare the contents properly. Purely by accident clicked on the tab when it showed as disabled!

    Also tried,

    procedure TForm1.FormCreate(Sender: TObject);

    begin

    sPageControl1.Pages[1].Enabled := false;

    sPageControl1.Pages[2].Enabled := false;

    sTabSheet2.Enabled := false;

    sTabSheet3.Enabled := false;

    end;

    but it didn't work. Did I miss a property?

    Delphi XE, Vista 64bit

    demo attached with internal Aluminium skin just to clarify exactly.

    Thanks 🙂

    #49812
    Hamilton
    Participant

    Hi Darren,

    I think the Tabsheet.Visible property might be what you're after?

    PS Not sure if someone has addressed your other posts yet I've been busy will try look into it later.

    Regards,

    Hamilton

    #49813
    DarrenB
    Participant

    Hmmm looks like I just deleted the bulk of this post… uggggggggg! What u see here isn't what was here 10 mins ago.

    Did you see it, Hamilton? God sometimes I hate cut and paste when I'm editing something

    Essence was, visible property didn't help and in fact didn't seem to do much at all… also setting it in the IDE (to false) running program, coming back to IDE and the property was always true…? Is that normal?

    Whatever combination of enabled, visible properties I use, Tabsheet tab is always visible, and clickable… but text on tabsheet tab appears disabled.

    I'm sure I must be doing this wrong unless it's a bug?

    #49986
    Support
    Keymaster

    Hello Darren!

    I'm sorry for a long answer here.

    TsPageControl have standard behaviour. I think, you should disable the AccessibleDisabledPages property. You saw it?

    #50135
    DarrenB
    Participant
    'Support' wrote:

    TsPageControl have standard behaviour. I think, you should disable the AccessibleDisabledPages property. You saw it?

    Hi Serge,

    didn't see that property…thanks that worked just fine 🙂

    Best Wishes :a3:

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.