DropDownItems cannot display while be added programlly

Mar 14, 2013 at 8:37 AM
Edited Mar 14, 2013 at 8:57 AM
Hi,

DropDownItems cannot be seen while added programlly, but it works in design mode.

code below:
With Me.RibbonButton3
    .DropDownItems.Clear()
    For i As Integer = 0 To SQLiteFunctionTable.Rows.Count - 1
        Dim btn As New RibbonButton(SQLiteFunctionTable.Rows(i).Item("Name").ToString & "()")
        .DropDownItems.Add(btn)
        btn.ToolTip = "xxxxx"
    Next
End With
I think it seemed almost the same with which generated by the Form Designer.

In fact, a list can be created and shown successfully after clicked RibbonButton3, but whose DropDownBounds.Height is zero.

Regards
Developer
Mar 14, 2013 at 12:59 PM
How many items are you trying to add?
If you exceed the screen size nothing will be displayed (no scrollbars available).
Mar 14, 2013 at 1:19 PM
Oh yes you are right :-(

It seemed that I have to split the DropDownItems into some sections. Thanks a lot.
Developer
Mar 14, 2013 at 2:09 PM
An alternative solution as described by supernorb. Use RibbonHost and .net ComboBox:

http://www.codeproject.com/Messages/4513821/sRe-Add-item-to-DropDownItems-of-RibbonComboBox-pr.aspx
Mar 15, 2013 at 1:06 AM
I'll try this method. It's a suggestion that a RibbonComboBox inherit from ComboBox could be added in your project :-) Thanks for your reply.