Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - SOLVED: Dynamically add items to Splitbutton
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED: Dynamically add items to Splitbutton

 Post Reply Post Reply
Author
Message
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED: Dynamically add items to Splitbutton
    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.
 
 
 
 
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....
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2008 at 7:22am
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
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.219 seconds.