473,721 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3127
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******** **********@tk2m sftngp13.phx.gb l...
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******** **********@tk2m sftngp13.phx.gb l...
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******@hotma il.com> escribió en el mensaje
news:uL******** ******@TK2MSFTN GP14.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******** **********@tk2m sftngp13.phx.gb l...
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.e ess> wrote in message
news:%2******** ********@TK2MSF TNGP09.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******@hotma il.com> escribió en el mensaje
news:uL******** ******@TK2MSFTN GP14.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******** **********@tk2m sftngp13.phx.gb l...
>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.Con trols.Add(Me.Co mboBox1)
///

It is strange

I hope this helps?

Cor

"Juan" <ss************ **@tteerrrraa.e ess>

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******@hotma il.com> escribió en el mensaje
news:uL******** ******@TK2MSFTN GP14.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******** **********@tk2m sftngp13.phx.gb l...
>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
2082
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 = CommandBars("MyToolbarName").Controls.Add(Type:=msoControlComboBox) With newcombo .AddItem "(Prompt User)Select an Item fro the List:" .AddItem "-----------------------------" .AddItem "Item Three"
7
2355
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 tab control (very similar to outlook express). I then started coding and realised that I needed to add a ToolBar. When I added this, it didn't appear at the top as expected, but at the top of the tab control and I couldn't get it to appear where...
2
3050
by: VM | last post by:
Is it possible to add other controls (textboxes, buttons, etc...) into a Windows toolbar? Thanks.
4
1526
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). Underneath that it says "Use this control in the same manner as you would a regular System.Windows.Forms.ComboBox. Add it to your form, via the designer or programmatically as detailed below".
5
4661
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 combo by allowing the user to dynamically type in the new value directly in the combo box whcih in turn updates the lookup table and then when they have finished leaves that particular cell on the grid with the correct value. Seems...
1
1413
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
4476
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 making it a shortcut menu. I have no problem linking it to the list control. The menu comes up when I right-click the list control.
1
1263
by: parvelli | last post by:
adding a new combobox in a toolbar using vb.netv please help me deepak
1
1532
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 AddToolbarItemFontSizeCombo(string name, string text) ComboBoxItem comboBox = new ComboBoxItem(name,text); comboBox.Size = new System.Drawing.Size(40,10); double size = 0.25;
0
8851
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9143
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6676
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4761
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2588
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2137
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.