Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Attaching controls to Commandbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Attaching controls to Commandbar

 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: Attaching controls to Commandbar
    Posted: 06 February 2008 at 12:01pm
When attaching a Combobox, Colorpicker (in general controls which have a dropdown section) to a commandbar, mousedown event outside the dropdown commandbar area (but inside the combobox dropdown area) causes the dropdown area to disappear or sometimes will lose the handle (I think) with the attached control. Combobox is floating where you put in the IDE. Click on the on the commandbarbutton again will attach the control to the commandbar.
 
If combobox is in picturebox sometimes the dropdown area of commandbar disappears.
 
Am I missing something here?
 
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: 07 February 2008 at 1:01am
Hello,
 
Yes its true. :-( Can you use Our builtin CommandBarComboBox and Colopicker ?
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: 07 February 2008 at 4:15pm
 
 
 

Oleg,

You wouldn't believe me if I said that the combobox isn't working properly ,  and for the Colorpicker I didn't really put much effort in it. It's not that important since I use the propertygrid for all my app settings. Great control by the way

 
Now, this is what I did
 
I added the combobox to the commandbar, then:
 
Dim toolComboTest As CommandBarComboBox
    Set toolComboTest = CommandBarSubviews.FindControl(, ID_TOOLBAR_TEST)
        Dim i As Integer
        For i = 1 To 20
            toolComboTest.AddItem "Select item " & i
        Next i
       
        toolComboTest.DropDownListStyle = True
        toolComboTest.DropDownWidth = 100
        toolComboTest.ListIndex = 1
        toolComboTest.Width = 200
        toolComboTest.ThemedItems = false'' see picture 1
        toolComboTest.ThemedItems = True '' see picture 2
        
        
This is another combobox (works properly)

    Set toolComboControlitems = CommandBarSubviews.FindControl(, ID_TOOLBAR_COMBOCONTROLITEMS)
        toolComboControlitems.AddItem "Select item..."
        toolComboControlitems.ListIndex = 1
        toolComboControlitems.Width = 250
        toolComboControlitems.ThemedItems = True ''LOOK, set to true and the items will be set to for example: another font
 
 
Picture 1
 
 
Picture 2
 
 
Notice the width of the dropdown area. I feel an other adventure coming up hahaha. (This is not a laugh of joy...)
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: 08 February 2008 at 1:35am
Hi,
 
I need some sample to test. Please attach one.
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: 08 February 2008 at 3:08am
Oleg,
 
Just paste the code and you will see the behaviour I mentioned.
 
 
Const ID_TOOLBAR_TEST = 400
Const ID_TOOLBAR_COMBOCONTROLITEMS = 401
 
Private Sub Form_Load()
    LoadToolbarItems
End Sub
Private Function LoadToolbarItems()
   
    CommandBarSubViews.DeleteAll
    
    Dim toolBarSubViews As CommandBar
    Set toolBarSubViews = CommandBarSubViews.Add("Tools subview", xtpBarTop)
        toolBarSubViews.BarID = 1
        AddButton CommandBarSubViews(1).Controls, xtpControlComboBox, ID_TOOLBAR_COMBOCONTROLITEMS, "", True, "Select item for positioning"
        AddButton CommandBarSubViews(1).Controls, xtpControlComboBox, ID_TOOLBAR_TEST, "Items", True, "Width / height size selected item", xtpButtonIconAndCaption
       
    Dim toolComboTest As CommandBarComboBox
    Set toolComboTest = CommandBarSubViews.FindControl(, ID_TOOLBAR_TEST)
        Dim i As Integer
        For i = 1 To 20
            toolComboTest.AddItem "Select item " & i
        Next i
        toolComboTest.Width = 150
        toolComboTest.ThemedItems = True
        toolComboTest.DropDownWidth = 400

    Dim toolComboControlitems As CommandBarComboBox
    Set toolComboControlitems = CommandBarSubViews.FindControl(, ID_TOOLBAR_COMBOCONTROLITEMS)
        toolComboControlitems.Width = 150
        toolComboControlitems.ThemedItems = True
   
        For i = 1 To 20
            toolComboControlitems.AddItem "Select item " & i
        Next i
   
    CommandBarSubViews.DockToolBar CommandBarSubViews(1), 0, 0, xtpBarTop
    CommandBarSubViews(1).EnableDocking XTPToolBarFlags.xtpFlagHideWrap
    CommandBarSubViews(1).ShowGripper = False
    CommandBarSubViews.Options.ShowExpandButtonAlways = False
   
   
End Function
Private Function AddButton(Controls As CommandBarControls, ControlType As XTPControlType, Id As Long, Caption As String, Optional BeginGroup As Boolean = False, Optional DescriptionText As String = "", Optional ButtonStyle As XTPButtonStyle = xtpButtonAutomatic, Optional Category As String = "Controls") As CommandBarControl
    Dim Control As CommandBarControl
    Set Control = Controls.Add(ControlType, Id, Caption)
   
    Control.BeginGroup = BeginGroup
    Control.DescriptionText = DescriptionText
    Control.Style = ButtonStyle
    Control.Category = Category
    Control.Enabled = True
    Set AddButton = Control
   
End Function
 
 
Change toolComboTest.DropDownWidth = 600 and the other combo takes over this setting.
 
 
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: 08 February 2008 at 3:11pm

Hi,

Its kind of feature :) If you use ThemedItems you need call it before you add items because ThemedItems =True destroy list, destroy items and create list again.
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: 10 February 2008 at 11:31am
Oleg,
 
Yes, I noticed the difference between the two combo's. With one the ThemedItems is set to true before filling the combo and the other one after the filling of the combo.
 
Is it possible to check this kind of behaviour somewhere? It would be nice that I know this in advance and not asking you everytime  I will be using a lot of settings which will be set to the users needs, so it would be nice if I could check this.
 
Thank you for the answer, now I the how and why
 
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.154 seconds.