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.
- JackSparrow8 years agoFrequent Contributor
Colin_McCrae in my app there is no " TPageControl " object.
- JackSparrow8 years agoFrequent Contributor
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_McCrae8 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 ...
- JackSparrow8 years agoFrequent Contributor
Related Content
- 12 months agolalit_singh
- 2 years agomitov
- 2 months agochris90mn