Print Page | Close Window

Ribbnbar selection

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6853
Printed Date: 19 June 2025 at 1:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbnbar selection
Posted By: cmm2006
Subject: Ribbnbar selection
Date Posted: 12 April 2007 at 7:34pm
hello,
How can I be able to detect wich ribbon tab was selected?
thank you,



Replies:
Posted By: Oleg
Date 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


Posted By: cmm2006
Date 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,
 


Posted By: Oleg
Date 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


Posted By: cmm2006
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net