Print Page | Close Window

EASY QUESTION: Programmatically Open Button Popup

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=11583
Printed Date: 26 April 2024 at 2:04pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: EASY QUESTION: Programmatically Open Button Popup
Posted By: JasonG
Subject: EASY QUESTION: Programmatically Open Button Popup
Date Posted: 25 July 2008 at 1:37pm
I have a commandbar button with a split/dropdown. When the button is clicked, I would like the dropdown menu to appear as if the dropdown arrow was clicked.

Private Sub CommandBarsThread_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
  If Control.Id = 18 Then
        .....
  End If
End Sub


-------------
Product: Xtreme SuitePro (ActiveX) 12.0.1
Platform: Windows Vista/XP
Language: Visual Basic 6.0 SP6



Replies:
Posted By: Aaron
Date Posted: 25 July 2008 at 2:38pm
Hi,
 
Try this:
 

Control.Execute
 
or
 
CommandBars.FindControl(, ID_FILE).Execute


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: JasonG
Date Posted: 25 July 2008 at 2:49pm
I tried that, and that gives me an 'out of stack space' error, because I'm causing an infinite loop.




-------------
Product: Xtreme SuitePro (ActiveX) 12.0.1
Platform: Windows Vista/XP
Language: Visual Basic 6.0 SP6


Posted By: JasonG
Date Posted: 25 July 2008 at 3:01pm
I should probably show how I am creating it as well.. an embedded frame.

Dim ControlForm As CommandBarControlCustom
Set ThreadBar2 = CommandBarsThread.Add("ThreadBar2", xtpBarRight)
Set C = ThreadBar2.Controls.Add(xtpControlSplitButtonPopup, 18, "Move To")
C.CommandBar.Controls.DeleteAll
Set ControlForm = C.CommandBar.Controls.Add(xtpControlCustom, 666, "Move")
ControlForm.Handle = fSendTo.hWnd




-------------
Product: Xtreme SuitePro (ActiveX) 12.0.1
Platform: Windows Vista/XP
Language: Visual Basic 6.0 SP6


Posted By: strider
Date Posted: 05 November 2008 at 3:41pm

The split popup control has a commandbar object.  The commandbar object has a showpopup method.  I used it right in the execute event to force the menu popup to appear:

Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
Dim controlpop As CommandBarPopup
If Control.ID = TBID_SplitButton Then
      Set controlpop = Control
      controlpop.CommandBar.ShowPopup
end if
 


-------------
ActiveX 13.2.1

Strider



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