Forum Discussion
Depends what kind of control they're using to manage their tabs?
In my Delphi app, they use a "TPageControl" object. This has an "FTabs" property. Which contains the list of tabs within the control container with new line separators.
So I have to extract these into an array. Find the one that matches the text I want. And then set the "ActivePageIndex" property of the control container to the index number of the matching tab. I think there is a method that allows you to set the active tab by name (SetActivePage or ChangeActivePage). But, as all my stuff is user data driven, I prefer to validate first which is why I do it the way I do. It makes sure a valid tab has been specified before it tries to switch to it.
You could use a direct method, but I would want error trap[ping round it in case a bad tab name is specified.
But this may be completely different for you. Depending on the tab controller in use.
Actually Aliases.Teachers_debug.frmMaintainDeal.TPanel.tabDeal.tabDayparts.click() or Aliases.Teachers_debug.frmMaintainDeal.TPanel.tabDeal.tabDayparts.SetFocus() is working but the tab is invisible so it is unable to change , so is there any way to change the properties of the tab from visible true to false or vice verse
OR
How to activate an invisible window
- Colin_McCrae9 years agoCommunity Hero
You're posting Alias names. These don't help me as I have no idea what they are.
In my Delphi application, as I mentioned, I have a "TPageControl" object (this is the class name) which is the container for all the tabs on that panel. This has child objects which are all the tabs. They are of class "TTabSheet". I find them,validate them and activate them using the TPageControl object, not directly. If I want to check if an individual tab is active, I check it's visibility and focus states. But, as I say, control is all done via the controller/container object.
Without knowing the class names of your objects, I have no idea of knowing what you're working with and therefore no idea how you would interact with it.
Also - your Alias reads these are nested tabs. You have tabDeal then tabDayparts. For me, this wouldn't make any difference. There would simply be two TPageControl objects. The second being a child object of one of the tabs on the first. No idea how this looks for you ...
- JackSparrow9 years agoFrequent Contributor
- Colin_McCrae9 years agoCommunity Hero
Right.
I suspect that is a custom class version of a TPageControl object.
It's class name is "TLMKPageControl". Looks suspiciously similar. It also has 23 child objects. Do you have 23 potential tabs in there? And does this object have methods such as "SetActivePage" if you associate it with the "TPageControl" class?
If it's a TPageControl, it should also have a Field "FTabs". This, in turn, should have a property "Text" which contains a list of all the tabs within the controller.
My application is compiled with debug info available. I'm not 100% certain these fields and properties will be present without this. But hopefully they are.