insert multi-column combobox into contextmenustrip?

andimanro

Member
Joined
Jun 7, 2010
Messages
18
Programming Experience
1-3
dear all..

how can i insert a multi-column combobox into a contextmenustrip ? is it possible to do that ?


Thnx



Andi
 
A ToolStripComboBox can be added to a ContextMenuStrip and it's just a regular ComboBox housed in a ToolStrip container, which means anything you can do with a regular ComboBox can be done to your ToolStripComboBox.

To access the regular ComboBox just use ToolStripComboBox.CombBox, the downside is that you have to set all the properties for the multi-column in code, not the properties window, but it is do-able.
 
Add a ToolStripComboBox to your ContextMenu (give it a name, but for this I'll just use the default):
VB.NET:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    With ToolStripComboBox1.ComboBox
        'Set properties for the multi-column stuff you want set.
    End With
End Sub
 
thnx again for ur response.. I really appreciate that..

i have set the properties like datasource and dropdown style inside the ToolStripComboBox1.ComboBox, but i have no idea how to set the multi-column properties.
can you help me to do that please....

sorry if I asked too much cause i'm still a vb net beginner... thnx
 
I just checked MSDN, I could have sworn the .Net ComboBox had a MultiColumn property but I'm not seeing it, might have been a VBA CombBox I was thinking of.

In any event I found this on CodeProject: Multi-Column ComboBox - CodeProject

Give it a try and see if it's a control you like, if so you can create a new ToolStrip control that houses that ComboBox in it. Here's how I did a ToolStripCheckBox: ToolStripCheckBox - VBForums just change it so the internal control isn't a CheckBox, it's the ComboBox.
 
Back
Top