473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 3099
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: lauren quantrell | last post by:
I use the following code to create a combobox in a toolbar: 'You must set a reference to the Microsoft Office x.0 Object Library to run this code! Dim newcombo Set newcombo =...
7
by: Andy Bates | last post by:
I have hopefully a simple problem in C#. I designed a form with a listview on left, vert splitter against that, then the remainder of the form from top to bottom: a listview, horiz splitter and...
2
by: VM | last post by:
Is it possible to add other controls (textboxes, buttons, etc...) into a Windows toolbar? Thanks.
4
by: Keith Smith | last post by:
I am reading this article... http://www.codeproject.com/cs/combobox/csautocomplete.asp About half-way down you will see a section titled "Using This Control" (written in orange lettering). ...
5
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound...
1
by: Marco Roberto | last post by:
Hi, is there anyway to add itens into a combobox after this control be bound with a dataset? Regards, Marco
1
by: stinehelferw | last post by:
I need a right-click menu on a form list control with combobox controls. I used View->Toolbars->Customize to create a toolbar. I added ComboBox through commands tab. I set properties to Popup...
1
by: parvelli | last post by:
adding a new combobox in a toolbar using vb.netv please help me deepak
1
by: tssutha | last post by:
hi all, I have problem when creating comboBox dynamically. i Could not change the size of the combobox whenb add this control to a ToolBar.. here is the code... private void...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.