Action in selecion tab

Support forum for ARG-Software Design Lab. Command Bars Library [http://www.arg.kirov.ru/]
Locked
Gianluca
Posts: 3
Joined: Sat Dec 05, 2009 10:48 am

Action in selecion tab

Post by Gianluca »

Hi,
can I handle the event ACTIVATE or CLICK when I select a tab in ribbon bar? Example: when I select a specific tab my app show a specific tab of pageframe located into form.

Best regards
Gianluca
Peter
Site Admin
Posts: 8
Joined: Sat Jul 18, 2009 1:56 pm

Re: Action in selecion tab

Post by Peter »

Hi Gianluca

Not quite sure what you mean. Are you attaching the commabars to the screen and using the Office 2007 type Toolbars or are you attaching toolbars to a form which then has a pageframe on it. Either way you can drill down to the click event of the Ribbon Bar and then code a selection of a particular tab to activate that tab. What version of VFP are you using? can you the use the debugger to look at the form object to find the correct path to the tab, or alternativley from the command window use IntelliSense.
I.E. From the Screen "_Screen.ActiveForm.PageFrame1.Page3.Activate" from a Ribbon Bar attached to a form "ThisForm.PageFrame1.Page3.Activate"
Please supply some more information.

Peter
AlexG
ARG-Software Design Lab.
Posts: 36
Joined: Sat Nov 14, 2009 5:14 pm

Re: Action in selecion tab

Post by AlexG »

OnTabChanged event of the Ribbon fires when active tab is changed. Parameter of this event is the index of the selected/active tab. Index specifies the index of the tab in the Tabs collection: 1 - first tab, 2 - second, and so on...

Code: Select all

*** OnTabChanged event
LParameters tnTabIndex
...
&& ThisForm.PageFrame1.ActivePage = m.tnTabIndex
In addition, there is OnTabChanging event, parameter is the index of the tab to be selected. Event fires when the active tab is about to be changed. To prevent active tab to be changed, return False. For example:

Code: Select all

*** OnTabChanging event
LParameters tnNewTabIndex
If <<ActiveTabShouldNotChang>>
    Return .F.
EndIf
See also ActiveTab property of the Ribbon, similar to the ActivePage property of VFP PageFrame class.
To change active tab programmatically, for example, select first tab:

Code: Select all

Ribbon.ActiveTab = 1

Please note: OnActiveTabChanged and OnTabSelected events are obsolete and will be removed.
With best regards,

Alex Grigorjev
(ARG-Software Design Lab.)
Gianluca
Posts: 3
Joined: Sat Dec 05, 2009 10:48 am

Re: Action in selecion tab

Post by Gianluca »

Hi Alex,

work fine... thanks
Gianluca
Locked