Print Page | Close Window

CXTPControlPopupColor - Single button

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=7904
Printed Date: 19 April 2024 at 12:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlPopupColor - Single button
Posted By: rupert
Subject: CXTPControlPopupColor - Single button
Date Posted: 30 August 2007 at 4:29pm
Is it possible to get a regular popup which can reflect the color selected in the picker?
 
CXTPControlPopupColor creates a split-button color control. I don't want it to be a split button.
 
Thanks.



Replies:
Posted By: Oleg
Date Posted: 03 September 2007 at 7:37am
Hi,
As quite weird trick you can add standard popup button + hidden CXTPControlPopupColor  with same id.
change Color property of hidden CXTPControlPopupColor  and it will change icon of your popup. Think can work.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rupert
Date Posted: 04 September 2007 at 10:44am
Thank you for the suggestion however I am unable to make it work. The icon color does not update. It remains the same.
 
 


Posted By: Oleg
Date Posted: 04 September 2007 at 12:41pm
This code work for me. Try also add RedrawBar in yours.
 
Private Sub CommandBars1_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    If (Control.Id = 101) Then
        CommandBars1.ActiveMenuBar.Controls(1).Color = vbGreen
        CommandBars1.ActiveMenuBar.RedrawBar
    End If
End Sub
Private Sub Form_Load()
Set CommandBars1.Icons = ImageManager1.Icons
Dim ControlPopup As CommandBarPopup
Set ControlPopup = CommandBars1.CreateCommandBarControl("CXTPControlPopupColor")
ControlPopup.Visible = False
CommandBars1.ActiveMenuBar.Controls.AddControl ControlPopup
ControlPopup.Id = 100
ControlPopup.Color = vbRed
Set ControlPopup = CommandBars1.ActiveMenuBar.Controls.Add(xtpControlPopup, 100, "Icon")
ControlPopup.Style = xtpButtonIcon
CommandBars1.ActiveMenuBar.Controls.Add xtpControlButton, 101, "Change"

End Sub


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rupert
Date Posted: 04 September 2007 at 2:07pm
Thank you, that works perfectly. I was failing to add the control to the command bar.



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