I also ran into this problem but it was a pretty simply solution...here's how I handled it (might be a better way so if anyone has any thoughts, that would be appreciated) and hopefully this Forum will not mess up the indentation too badly!
Setup: I have a class that is a collection of my clients called _ClientList and a SandRibbon.ComboBox that will display this list called cmbClient
cmbClient has a DisplaySize of 200, 19 and a DropDownSize of 200, 200
Private Sub LoadClients()
'Clear our Combo
cmbClient.Items.Clear()
Dim mySize As Size = cmbProject.DropDownSize
Dim MaxWidth As Integer = mySize.Width
' Populate CLIENT combo box
Dim Clients As New List(Of Divelements.SandRibbon.GalleryButton)()
For iCX As Integer = 0 To _ClientList.Count - 1
Dim ClientName As String = _ClientList.GetDescription(iCX)
Dim ButtonWidth As Integer = TextWidth(ClientName, cmbClient.Font)
If ButtonWidth > MaxWidth Then MaxWidth = ButtonWidth
Dim ClientButton As New Divelements.SandRibbon.GalleryButton(ClientName)
ClientButton.MinimumSize = New Size(190, 8)
ClientButton.Enabled = True
Clients.Add(ClientButton)
AddHandler ClientButton.Activate, AddressOf ClientButton_Clicked
Next
cmbClient.Items.AddRange(Clients.ToArray())
cmbClient.Enabled = True
' Set my dropdown width
mySize.Width = MaxWidth
cmbClient.DropDownSize = mySize
End Sub
Private Function TextWidth(ByVal myText As String, ByVal myFont As Font) As Integer
Dim myWidth As Integer = 0
Dim g As Graphics = Me.CreateGraphics
Dim mySizeF As SizeF = g.MeasureString(myText, myFont)
myWidth = CInt(mySizeF.Width)
g.Dispose()
g = Nothing
mySizeF = Nothing
Return myWidth
End Function
Hope this helps,
-LK