Jump to content

Hiding and showing tabs in a page control


wsv01

Recommended Posts

I am trying to set up a UniPageControl with 5 tabs in it. When the page appears, all tabs need to be hidden. When the user selects a menu option, a specific tab needs to appear. So, the menu system is basically controlling which tab will appear. In the simplest sense, for example, menu option 1 will show tab 0, menu option 2 will show tab 1 and so on. Only one tab will be shown at any specific time. As soon as the user selects a specific menu choice, all visible tabs should be made invisible and the one tab related to the menu choice will become visible. I just installed the latest trial version. Working on purchasing the software if I can just make it do some of the things I desire.

Link to comment
Share on other sites

OK,

 

Here is a code snip for you.

 

On create I run this

  UniPageControl1.Pages[0].Visible := false;
And I've tried this
  UniPageControl1.Pages[0].TabVisible := false;
 
Either one seems to hide the page.
 
 
On Click event of a test button I run this
  UniPageControl1.Pages[0].TabVisible := true;
or this
  UniPageControl1.Pages[0].Visible := true;
 
The tab does not appear. Does it have something to do with the page refreshing? Should I run that on the client side with some JS? If so, what would be the syntax?
Link to comment
Share on other sites

I finally figured it out.

If I hide all the tabs on the form CREATE event, they will never appear, however, if I hide all tabs on the ACTIVATE event, everything works as planned.

So, I guess setting control visibility on the form CREATE event is not a good idea.

Can anyone give some reasoning behind this method of operation?

 

Thanks...

Link to comment
Share on other sites

  • 5 weeks later...

Join the conversation

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

Guest
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...