472,122 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

Adding a Combobox to a Toolbar

I wanted to add a Combobox to a toolbar... Kind of the look you get on
VisualStudio's toolbar.

I've been able to find some VB 6 samples, but the placeholder option is no
longer available for ToolbarButtons...

Does anyone know how this could be done?

Looking forward to hear from you,

Juan
Nov 21 '05 #1
6 2969
http://msdn.microsoft.com/library/de..._vstoolbar.asp

or

Infragistics / other 3rd party controls
"Juan Pedro Gonzalez" <th******@terra.es> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
I wanted to add a Combobox to a toolbar... Kind of the look you get on
VisualStudio's toolbar.

I've been able to find some VB 6 samples, but the placeholder option is no
longer available for ToolbarButtons...

Does anyone know how this could be done?

Looking forward to hear from you,

Juan

Nov 21 '05 #2
Not sure if this is what you are looking for but, you can add a combobox to
a toolbar by dragging and dropping it onto a toolbar on your form.

You might find it better to create a menu, then add a button to the toolbar
that references that menu and has a style of dropdown.

These are all properties found in the toolbar buttons collection.

--
Gerry O'Brien
Visual Basic .NET MVP
"Juan Pedro Gonzalez" <th******@terra.es> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
I wanted to add a Combobox to a toolbar... Kind of the look you get on
VisualStudio's toolbar.

I've been able to find some VB 6 samples, but the placeholder option is no
longer available for ToolbarButtons...

Does anyone know how this could be done?

Looking forward to hear from you,

Juan

Nov 21 '05 #3
Helo,

When I drag and drop a ComboBox over the Toolbar, Visual Studio seems to add
the combo to the main form not the toolbar. After this I tried adding the
combo manually to the toolbar controls collection. This works fine, but some
times it messes up and the Form Designer won't show any controls at all.
When this happens if I modify anything on the Form designer, my entire form
gets whipped out and I find that my controls have dissapeared.

To solve this issue I created a new control inherited from the Toolbar and I
add here the ComboBox... The only problem here is that the ComboBox will
only show one item and the scroll. I need more items shown on the list.
Don't really know how to solve this issue at the moment. Help would be
appreciated.

Another problem is that the window must be fixed, since it won't resize
correctly the toolbar to fit the ComboBox... This issue isn't much of a
problem since I need it for a fixed (Not resizable) window.

The DropDown Button was another option I was considering, but I can't get a
fixed width for it, therefore it gives a strange felling when changing
items.

"Gerry O'Brien [MVP]" <gk******@hotmail.com> escribió en el mensaje
news:uL**************@TK2MSFTNGP14.phx.gbl...
Not sure if this is what you are looking for but, you can add a combobox to a toolbar by dragging and dropping it onto a toolbar on your form.

You might find it better to create a menu, then add a button to the toolbar that references that menu and has a style of dropdown.

These are all properties found in the toolbar buttons collection.

--
Gerry O'Brien
Visual Basic .NET MVP
"Juan Pedro Gonzalez" <th******@terra.es> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
I wanted to add a Combobox to a toolbar... Kind of the look you get on
VisualStudio's toolbar.

I've been able to find some VB 6 samples, but the placeholder option is no longer available for ToolbarButtons...

Does anyone know how this could be done?

Looking forward to hear from you,

Juan


Nov 21 '05 #4
All true. Sorry I didn't mention those issues.

Mark has also made some good suggestions as well in this thread.

I'm thought there was another way as well but it escapes me at the moment.
I'll have to dig a little further.

--
Gerry O'Brien
Visual Basic .NET MVP
"Juan" <ss**************@tteerrrraa.eess> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Helo,

When I drag and drop a ComboBox over the Toolbar, Visual Studio seems to
add
the combo to the main form not the toolbar. After this I tried adding the
combo manually to the toolbar controls collection. This works fine, but
some
times it messes up and the Form Designer won't show any controls at all.
When this happens if I modify anything on the Form designer, my entire
form
gets whipped out and I find that my controls have dissapeared.

To solve this issue I created a new control inherited from the Toolbar and
I
add here the ComboBox... The only problem here is that the ComboBox will
only show one item and the scroll. I need more items shown on the list.
Don't really know how to solve this issue at the moment. Help would be
appreciated.

Another problem is that the window must be fixed, since it won't resize
correctly the toolbar to fit the ComboBox... This issue isn't much of a
problem since I need it for a fixed (Not resizable) window.

The DropDown Button was another option I was considering, but I can't get
a
fixed width for it, therefore it gives a strange felling when changing
items.

"Gerry O'Brien [MVP]" <gk******@hotmail.com> escribió en el mensaje
news:uL**************@TK2MSFTNGP14.phx.gbl...
Not sure if this is what you are looking for but, you can add a combobox

to
a toolbar by dragging and dropping it onto a toolbar on your form.

You might find it better to create a menu, then add a button to the

toolbar
that references that menu and has a style of dropdown.

These are all properties found in the toolbar buttons collection.

--
Gerry O'Brien
Visual Basic .NET MVP
"Juan Pedro Gonzalez" <th******@terra.es> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
>I wanted to add a Combobox to a toolbar... Kind of the look you get on
> VisualStudio's toolbar.
>
> I've been able to find some VB 6 samples, but the placeholder option is no > longer available for ToolbarButtons...
>
> Does anyone know how this could be done?
>
> Looking forward to hear from you,
>
> Juan
>
>



Nov 21 '05 #5
Juan,

The answer is very simple, the draging of the toolbar acts strange. It has a
kind of effect what has to do with the Z (bottom up) order of placing
controls what is forever strange with controls where is the dock (as is
standard with the toolbar) set.

When you first set a control on a form
Than the toolbar and than drag the control over the toolbar you have a
problem.

When you first drag your toolbar on a form and than the control over it, it
goes fine.
\
\\This shows the combobox in the first way 'strange behaviour of the
designer
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.ToolBar1)
///
\\\This shows the combobobox not it is in the second way 'same strange
behaviour
Me.Controls.Add(Me.ToolBar1)
Me.Controls.Add(Me.ComboBox1)
///
\\\This shows as well and when done will be corrected in the desinger to set
it in the toolbar
Me.Controls.Add(Me.ToolBar1)
Me.ToolBar1.Controls.Add(Me.ComboBox1)
///

It is strange

I hope this helps?

Cor

"Juan" <ss**************@tteerrrraa.eess>

When I drag and drop a ComboBox over the Toolbar, Visual Studio seems to
add
the combo to the main form not the toolbar. After this I tried adding the
combo manually to the toolbar controls collection. This works fine, but
some
times it messes up and the Form Designer won't show any controls at all.
When this happens if I modify anything on the Form designer, my entire
form
gets whipped out and I find that my controls have dissapeared.

To solve this issue I created a new control inherited from the Toolbar and
I
add here the ComboBox... The only problem here is that the ComboBox will
only show one item and the scroll. I need more items shown on the list.
Don't really know how to solve this issue at the moment. Help would be
appreciated.

Another problem is that the window must be fixed, since it won't resize
correctly the toolbar to fit the ComboBox... This issue isn't much of a
problem since I need it for a fixed (Not resizable) window.

The DropDown Button was another option I was considering, but I can't get
a
fixed width for it, therefore it gives a strange felling when changing
items.

"Gerry O'Brien [MVP]" <gk******@hotmail.com> escribió en el mensaje
news:uL**************@TK2MSFTNGP14.phx.gbl...
Not sure if this is what you are looking for but, you can add a combobox

to
a toolbar by dragging and dropping it onto a toolbar on your form.

You might find it better to create a menu, then add a button to the

toolbar
that references that menu and has a style of dropdown.

These are all properties found in the toolbar buttons collection.

--
Gerry O'Brien
Visual Basic .NET MVP
"Juan Pedro Gonzalez" <th******@terra.es> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
>I wanted to add a Combobox to a toolbar... Kind of the look you get on
> VisualStudio's toolbar.
>
> I've been able to find some VB 6 samples, but the placeholder option is no > longer available for ToolbarButtons...
>
> Does anyone know how this could be done?
>
> Looking forward to hear from you,
>
> Juan
>
>



Nov 21 '05 #6
Juan,

doh.
\ \\This shows the combobox, it is the second way 'strange behaviour of the
designer
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.ToolBar1)
///
\\\This shows the combobobox not, it is in the first way
Me.Controls.Add(Me.ToolBar1)
Me.Controls.Add(Me.ComboBox1)
///


Sorry I made it a little bit confusing.

Cor
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Andy Bates | last post: by
4 posts views Thread by Keith Smith | last post: by
5 posts views Thread by Aaron Ackerman | last post: by
1 post views Thread by Marco Roberto | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.