Index param in AddItem Method |
Post Reply |
Author | |
jamauss
Newbie Joined: 08 December 2003 Location: United States Status: Offline Points: 6 |
Post Options
Thanks(0)
Posted: 27 January 2004 at 12:18pm |
I am using the ActiveX XTremeCommandBars. I am putting a combo box into my toolbar. When I call the AddItem method and pass a string and an index value, no items show up in my combo box unless [index] is 1 and then only goes 2, 3, 4 as I add more items. Why does it do this? Is it a requirements to only have sequential index values starting at 1?
|
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
jamauss, I think this is normal. It appears that the 'index' parameter is like the 'before' parameter in a VB collection (although the object doesn't support named arguments). c.AddItem "Test1", 1 Is like saying: add Test1 before anything add Test2 before the 2nd item (if it exists) add Test3 before the 2nd item (if it exists) So the list would be: Test1,Test3, Test2
rob Edited by robs |
|
jamauss
Newbie Joined: 08 December 2003 Location: United States Status: Offline Points: 6 |
Post Options
Thanks(0)
|
OK, then why don't any of the items in my list appear? Try adding items using index values like 3, 4, and 5 (in that order) and you'll see that no items appear in your combo box. Also - there is no "ItemData"-type property for the combo boxes then so you can associate ID values with combo list items? That's practically the whole purpose for having combo boxes. Some functionality is severely lacking here. |
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
Yep, I see what you are saying. I think what I said before is correct, with an exception: c.AddItem "Test2",2 will add "Test2" before item 2 if it exists-however, if it does not then it won't add it at all. I agree with you that the combo boxes are lacking. One would expect them to behave like a standard combo box. Perhaps the folks at Codejock with recognize this as a bug, or consider it for a future enhancement. Would you consider using a custom control (standard ComboBox) instead? Then you should have the functionality of a standard combobox. It's not the best sollution but... Drop a combo on your form (Combo1) Dim mCustom As ICommandBarControlCustom Set mCustom = CommandBars.Add(xtpControlCustom, id, label)
Edited by robs |
|
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 |