Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Ribbnbar selection
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbnbar selection

 Post Reply Post Reply
Author
Message
cmm2006 View Drop Down
Senior Member
Senior Member


Joined: 26 September 2006
Status: Offline
Points: 118
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmm2006 Quote  Post ReplyReply Direct Link To This Post Topic: Ribbnbar selection
    Posted: 12 April 2007 at 7:34pm
hello,
How can I be able to detect wich ribbon tab was selected?
thank you,
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2007 at 12:40am
Hi,
 
In your Execute event add:
 

Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    On Error Resume Next
   
    Select Case Control.Id
        Case XTPCommandBarsSpecialCommands.XTP_ID_RIBBONCONTROLTAB:
            Debug.Print "Selected Tab is Changed"
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
cmm2006 View Drop Down
Senior Member
Senior Member


Joined: 26 September 2006
Status: Offline
Points: 118
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmm2006 Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2007 at 3:06pm
hello,
I tried your code, but it seems that all the ribbon tabs have the same id "9604", and that is not helping me at all.
so how can I be able to make the difference between the tabs?
thank you,
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2007 at 1:38am
Hi,
yes, this code help to find event when selected tab was changed.  to find selected tab use something like:
 
if (RibbonBar.Tab(1).Selected) then
 
or
 
RibbonBar.SelectedTab
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
cmm2006 View Drop Down
Senior Member
Senior Member


Joined: 26 September 2006
Status: Offline
Points: 118
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmm2006 Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2007 at 11:06am
Okay,
I used RibbonBar.SelectedTab with the select statment to find out wich tab was selected, but everytime I select tab with the index 1, the application crashed and VB6 is closed. I dont't know if I am doing something wrong or it's something else.
My code:
 
 
Dim RibbonBar As RibbonBar
 
Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
Select Case Control.Id
Case XTPCommandBarsSpecialCommands.XTP_ID_RIBBONCONTROLTAB:
    Select Case RibbonBar.SelectedTab.Index
        Case 0
            Report1.Visible = False
            Calendar1.Visible = True
        Case 1
            Calendar1.Visible = True
            Report1.Visible = False
        Case 2: MsgBox "Other"
    End Select
Case 1000: End
Case 201: Calendar1.ViewType = xtpCalendarWorkWeekView
Case 200: Calendar1.ViewType = xtpCalendarDayView
Case 202: Calendar1.ViewType = xtpCalendarWeekView
Case 203: Calendar1.ViewType = xtpCalendarMonthView
End Select
End Sub
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.