Combo boxes with 'draggable' icons |
Post Reply |
Author | |
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
Posted: 04 February 2008 at 9:51pm |
I want to do the ff, using CommandBars :
1). Display a dropdown list combobox in a toolbar 2). Display an image (icon) and text in the items displayed in the combo box 3). Have the items in the combo box sorted alphabetically (by text) 4). Be able to select and 'drag' an item from the combo box list onto a form (for example) and be able to recognize the item that was dragged onto the form - note, dragging an item from the list should not remove it from the list, i.e. the list should remain unchanged after a user selects an item by 'dragging' it from the combobox and 'dropping' it on a form I wonder if it is possible to do this using command bars ? I realize that there are quite a lot of steps there, and maybe one person may not have all the answers, but if anyone feels they know the answers to any (or all) of the steps, I will be very grateful to see how I can code this using teh CommandBar activeX control (I am using VB6) |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Unfortuantelly Combo doesn't support drag. :-(
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Neil,
You could add a CommandBarControlCustom (in your case a combobox) to your commandbar and set the handle to your own combobox which does support drag&drop.
An other option would be adding a ControlSplitButtonPopup to your commandbar. Add the items you want with text and icon. This option isn't that different when using a combox, you have a dropdown section just like the combobox and CommandBars seem to support drag&drop so this should do the trick
|
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hi Aaron,
Sorry to bother you again, but could you please post a few lines of code to show how I may do this (I prefer the second option - using ControlSplitButtonPopup). I am quite new to the CommandBar controls, and the object heirarchy is proving to be a bit of a 'forest' to navigate through quickly without samploe snippets. Thanks |
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
I did a quick search for 'ControlSplitButtonPopup' in the documentation - no items were found. I tried various combinations of the term, but still found nothing. Is this the correct spelling of the object?
|
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
ok, found it as 'xtpControlSplitButtonPopup'
I'm now looking to see if I can create an example, using this button type, and put in a toolbar - if you could send a few lines that show how to do this, I'd be very grateful. Thanks Neil |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Neil, Delete the Update event I previously sent you. And replace the Execute event with this new one.
Const ID_TOOLBAR_COMBO = 1000 '' this is the ID for the SplitButton Private Function LoadToolbars()
|
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hi Aaron,
In case you are struggling to provide an example that shows how to do what I wanted to do (thanks for the last snippet by the way - great help), please post the last message I sent to you, in here, so that maybe someone else may take a look at it if you are not quite sure how to solve it - I accidentally posted it to you as a private message, and I can't retrieve the text I sent. Thanks Neil |
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Oleg,
Does any other 'list of items' control (that can be displayed in a toolbar) support drag? |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Neil,
Here's the post as you asked me to add to the original post
Aaron,
This is what I'm trying to do. I have a rather long list that I want to display in a combo box in a toolbox. thanks to the code you sent me, I now know how to place the combo box in a toolbar, and how to add images to the toolbar.
There are two other things that I still need to find out how to do: 1). Restrict the number of items of items on display, at any one time. I will have potentially, over 100 items to display in the combo box, but I want to be able to limit that to a reasonable number (say 10). Ideally, I would like to make it possible for the user to type in the first character, and then simply show items begining with that character. I could have sworn that I saw a CommandBar example somewhere that shows how to filter items in a dropdown list as a user is typing - but for the lif e of me, I cannot find that anywhere - and I've searched EVERYWHERE. If I can find out how to do this (or similar), that would be absolutely fantastic - since showing over 100 items in a menu is not really practical. 2). Implementing 'drag drop, so that a user can select an item from the list, drag it and drop it on (say) a form. Thanks very much for takling the time out to help me out. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Neil, actually galleries support drag. If you have last CommandBars, try this sample:
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |