Print Page | Close Window

How to add a custom control to a Ribbon group

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=12620
Printed Date: 07 October 2024 at 4:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to add a custom control to a Ribbon group
Posted By: fernando
Subject: How to add a custom control to a Ribbon group
Date Posted: 06 November 2008 at 10:26am
Hi,

I'd like to add a custom control to a RibbonBar group. How ca I do this? 

I was expecting to fin a Handle property in the CommandBarControlCustom as in the TaskPanelGroupItem, but couldn't find any.

Thanks in advance



Replies:
Posted By: fernando
Date Posted: 06 November 2008 at 10:58am
Got it, nevermind.


Posted By: fernando
Date Posted: 06 November 2008 at 11:07am
Hi,

I have managed to add the custom control using the Handle property, but now I'm having a very odd issue: the custom control appears out of the RibbonBar group until I click on the group. Then it gets docked.

How can I have it docked from the beginning???

Here's the code I'm using:
--------------------------------------------------------------------------------------------
Dim rGroup As RibbonGroup
Dim rItem As XtremeCommandBars.CommandBarControlCustom

Set rTab = m_rRibbon.Tab(2)

Set rGroup = rTab.Groups.AddGroup("Creating Resumes", 45)


Set rItem = rGroup.Add(xtpControlCustom, eResumesComboItem, rcString(eResumesComboItem))
rItem.Handle = m_rView.ResumeCombo.WindowHandle


After thsi code runs, the custom control (ResumeCombo) isn't docked and is displayed out of the ribbonbar.  How can I fix this?

Thanks in advance,
Fernando
PS I'musing VB6 and version 10.4.2


Posted By: ijwelch
Date Posted: 07 November 2008 at 7:57pm
I think it'll work if you put the m_rView.ResumeCombo in a PictureBox first, then use rItem.Handle = PictureBox.hWnd


Posted By: TShriver
Date Posted: 06 March 2009 at 12:26pm
I'm having the opposite effect.  I've added a xtpControlCustom item the DateTimePicker and it shows up in the RibbonBar until I click it.  Then it shows up as a button.
 
   Dim TabAdvanced As RibbonTab
   Set TabAdvanced = RibbonBar.InsertTab(7, "&Advanced")
   TabAdvanced.Id = ID_TAB_ADVANCED
   
   Set ViewGroup = TabAdvanced.Groups.AddGroup("&Advanced Controls", ID_GROUP_ADVANCED)
   ViewGroup.ControlsCentering = True
   
   Dim ItemCustom As XtremeCommandBars.CommandBarControlCustom

   Set ItemCustom = ViewGroup.Add(xtpControlCustom, 777, "Time", False, False)
   ItemCustom.Handle = TimePicker.hWnd

Before Click:
 
After Click:
 
Any ideas???
 
Thanks,
 
Tim



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