Print Page | Close Window

Second Sub Menu Item xtpControlPopup Populate

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=4841
Printed Date: 20 June 2025 at 3:44pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Second Sub Menu Item xtpControlPopup Populate
Posted By: daveED
Subject: Second Sub Menu Item xtpControlPopup Populate
Date Posted: 21 August 2006 at 11:29am
Hellow, Can not Create a third Popupmenu with code.
I can create it in the desiner but not in code
could you please help?
 
this is what im trying to do in code
 
 
    Item One
    xtpControlPopup >  Sub 2 Item 1
                                     xtpControlPopup >  Sub 3 Item 1
                                                                      Sub 3 Item 2
 
 
Here is the Code:
 
Private Sub textArea_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    If (Button = 2) Then
        ZOrder
       
        Dim Popup As CommandBar
        Dim Control As CommandBarControl
       
        Set Popup = CommandBars.Add("Popup", xtpBarPopup)
      With Popup.Controls
            .Add xtpControlButton, ID_EDIT_CUT, "Cu&t", -1, False
            .Add xtpControlButton, ID_EDIT_COPY, "&Copy", -1, False
            .Add xtpControlButton, ID_EDIT_PASTE, "&Paste", -1, False
       
            Control.BeginGroup = True
            .Add xtpControlButton, ID_INSERT_BULLET, "Bullets", -1, False
          
            Set Control = .Add(xtpControlPopup, 0, "Styles")

   Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLEBLUE, "Luna"
    Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLEBLACK, "Obsidian"
    Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLEAQUA, "Office 12" 
    
Set Control = .Add(xtpControlPopup, 0, "Extra Styles")
  Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLETESLA, "Tesla"
Control.CommandBar.Controls.Add xtpControlButton, ID_OPTIONS_STYLETITAN, "Titan" 
         
        End With
    
        Popup.ShowPopup
    End If
End Sub
 
Yours Faithley,
David
 



Replies:
Posted By: Oleg
Date Posted: 21 August 2006 at 2:57pm
instead
 
Set Control = .Add(xtpControlPopup, 0, "Extra Styles")
try
 
Set Control =  Control.CommandBar.Controls.Add(xtpControlPopup, 0, "Extra Styles")


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


Posted By: daveED
Date Posted: 22 August 2006 at 2:41am
Thank you oleg,
That works fine, no worries



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