Print Page | Close Window

SOLVED: Dynamically add items to Splitbutton

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=11918
Printed Date: 24 December 2024 at 12:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: Dynamically add items to Splitbutton
Posted By: Aaron
Subject: SOLVED: Dynamically add items to Splitbutton
Date Posted: 21 August 2008 at 5:45am
Hi,
 
I'm trying to make a dropdownmenu which can be used also as a toolbar and eventually as popupmenu. Just one function which create menu items for all options. I guess it is possible what I want but I can't get it right. Would someone be so kind and look at the code and tell me what to change.
 
  https://forum.codejock.com/uploads/20080821_054620_TestIssues.zip - uploads/20080821_054620_TestIssues.zip
 
 
 
Thanks in advance  


-------------
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....



Replies:
Posted By: Oleg
Date Posted: 21 August 2008 at 7:22am
Try this:
 
https://forum.codejock.com/uploads/20080821_072153_e.zip - uploads/20080821_072153_e.zip


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


Posted By: Aaron
Date Posted: 21 August 2008 at 7:46am
Hi Oleg,
 
Thanks, does this mean it isn't possible with my original idea?
 
When I have more options to add to the dropdown menu, it wouldn't be a bad idea to have a label to let the user know what to expect. But now, with only one option it looks kind of weird...
 
I prefer just to build one menu item which can be used for several options: Menu, Toolbar and PopupMenu so creating a seperate toolbar just with same buttons isn't an option as well.
 
If you think of something else, I mean another idea, you're welcome to share them with me
 
Thanks again Oleg
 


-------------
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: Oleg
Date Posted: 22 August 2008 at 1:17am
Hi,
 
Here another solution:
 
Private Sub CommandBars_InitCommandsPopup(ByVal CommandBar As XtremeCommandBars.ICommandBar)
   
    Dim col As XtremeReportControl.ReportColumn
    Dim Control As CommandBarControl, ControlItem As CommandBarControl
    Dim ctrlButton As CommandBarButton
   
    If (Not CommandBar.Parent Is Nothing) Then
   
        If CommandBar.Parent.Id = 1002 Then
            CommandBar.Controls.DeleteAll
            If currentReportVisible.Columns.Count > 0 Then
                For Each col In currentReportVisible.Columns
                    Set ctrlButton = CommandBar.Controls.Add(xtpControlCheckBox, col.ItemIndex + 1 + 1002, col.Caption)
                        ctrlButton.CloseSubMenuOnClick = False
                        ctrlButton.Checked = col.Visible
                Next col
            End If
        End If
    End If
End Sub
replace it in original sample.


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


Posted By: Aaron
Date Posted: 22 August 2008 at 2:38am
Hi Oleg,
 
That's what I was looking for  
 
Thanks a lot.
 
 


-------------
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....



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