Multi-level combo box

  • Thread starter Thread starter Exclaim_Jim
  • Start date Start date
E

Exclaim_Jim

Hi

I am writing a VB.Net app which is to replace an existing Java app. The
Java author had access to a special control which looks like a combo box
on the form, but which behaves more like a menu in that the user can
select an item from the combo box and a second level of selections opens
up to the right of the mouse pointer on dragging rightwards.

Has anyone created a control like this for VB.Net? Can the native
ComboBox control be used in this way? I am on VB.Net 2005.

Regards

-- Jim.
 
If you're talking about a desktop app, TreeView items can have a checkbox.
That SOUNDS like it might work for you. (I don't know if the web control
has the same capability.)

Bob
 
eBob.com said:
If you're talking about a desktop app, TreeView items can have a checkbox.
That SOUNDS like it might work for you. (I don't know if the web control
has the same capability.)

Bob

It is a desktop app I'm talking about.

The beauty of the existing Java thing is that the user can select first
a top level option then a second level option (dependant on the first)
in one mouse-down and drag movement.

-- Jim.
 
Captain said:
One option would be to use either a ToolStrip or a MenuStrip. Add the item
to your form, change the Dock property to None, and drag it to where you
want. You'll likely want to set AutoSize to False, and (for the ToolStrip)
set the GripStyle property to Hidden. You can add a single item to the strip
that can be your menu. If you need for it to behave like a combo box by
displaying the text of the item selected, you can change the Text property
of the top level button to match what was entered.

With a ToolStripButton on the ToolStrip, you'd have the option of displaying
a graphic of a down arrow to the right of the text, so it would even look a
bit like a combo box. For that matter, if you wanted to get really fancy, I
imagine you could create a class that inherits from ToolStripButton or
ToolStripDropDownMenu and override it's OnPaint method to make it look
however you wanted.
Top idea- I'll give it a go. Many thanks.

-- Jim.
 
Back
Top