PC Review


Reply
Thread Tools Rate Thread

Adding a Combobox to a Toolbar

 
 
Juan Pedro Gonzalez
Guest
Posts: n/a
 
      23rd Nov 2004
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


 
Reply With Quote
 
 
 
 
Mark Jones
Guest
Posts: n/a
 
      23rd Nov 2004
http://msdn.microsoft.com/library/de..._vstoolbar.asp

or

Infragistics / other 3rd party controls


"Juan Pedro Gonzalez" <(E-Mail Removed)> wrote in message
news:%23l53t%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Gerry O'Brien [MVP]
Guest
Posts: n/a
 
      23rd Nov 2004
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" <(E-Mail Removed)> wrote in message
news:%23l53t%(E-Mail Removed)...
>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
>
>



 
Reply With Quote
 
Juan
Guest
Posts: n/a
 
      24th Nov 2004
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]" <(E-Mail Removed)> escribió en el mensaje
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%23l53t%(E-Mail Removed)...
> >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
> >
> >

>
>



 
Reply With Quote
 
Gerry O'Brien [MVP]
Guest
Posts: n/a
 
      24th Nov 2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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]" <(E-Mail Removed)> escribió en el mensaje
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:%23l53t%(E-Mail Removed)...
>> >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
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      24th Nov 2004
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" <(E-Mail Removed)>
>
> 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]" <(E-Mail Removed)> escribió en el mensaje
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:%23l53t%(E-Mail Removed)...
>> >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
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      24th Nov 2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get value from combobox on toolbar Dan Microsoft Excel Programming 1 7th Jan 2009 06:11 PM
ComboBox Toolbar Nader Microsoft Excel Discussion 2 13th Aug 2007 02:59 PM
ComboBox Toolbar Nader Microsoft Excel Programming 0 10th Aug 2007 05:59 PM
ComboBox in Toolbar AliR Microsoft C# .NET 0 3rd Sep 2004 07:52 PM
combobox in the toolbar Vadym Stetsyak Microsoft Dot NET Framework Forms 2 28th Jul 2003 07:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:32 AM.