Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to add a custom control to a Ribbon group
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to add a custom control to a Ribbon group

 Post Reply Post Reply
Author
Message
fernando View Drop Down
Groupie
Groupie
Avatar

Joined: 22 May 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernando Quote  Post ReplyReply Direct Link To This Post Topic: How to add a custom control to a Ribbon group
    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
Back to Top
fernando View Drop Down
Groupie
Groupie
Avatar

Joined: 22 May 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernando Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2008 at 10:58am
Got it, nevermind.
Back to Top
fernando View Drop Down
Groupie
Groupie
Avatar

Joined: 22 May 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernando Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
TShriver View Drop Down
Groupie
Groupie
Avatar

Joined: 27 July 2008
Location: United States
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote TShriver Quote  Post ReplyReply Direct Link To This Post 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
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.125 seconds.