Malfunction Posted December 16, 2003 Posted December 16, 2003 Hi, I need some sort of font size selection in my toolbar, just like work has. Adding a new button with the dropdown property set and having contextmenu containing the fontsizes connected doesn't work since there's no label to show the current size next to the little arrow. Quote Debug me...
Mothra Posted December 16, 2003 Posted December 16, 2003 Instead of using a button/context menu, just use a ComboBox. Then it would be the same interface pretty much everyone is used to seeing. Quote Being smarter than you look is always better than looking smarter than you are.
Malfunction Posted December 17, 2003 Author Posted December 17, 2003 ...., just use a ComboBox. ..... thx for the hint but how do I add a combobox to the toolbar. I thought the only way to add something to the toolbar was using the button enumeration. Quote Debug me...
Voca Posted December 17, 2003 Posted December 17, 2003 You can add whatever Control you want: The following code is from a project I've been working at: Protected withEvents oCont as System.Windows.Forms.ContainerControl Protected withEvents Label1 as System.Windows.Forms.Label Protected WithEvents _rebar as System.Windows.Forms.ReBar Protected Sub SetBar() Me.Label1.Text = "Some string" Me.Label1.Left = 0 Me.Label1.Top = 0 Me.oCont.Controls.Add(Me.Label1) _rebar.Bands.Add(oCont) End Sub Of course there could be better ways, but thats my solution. I added my Label to a new Toolbar. But I think if your searching a little bit, you can add it to your Toolbar that easy. Any questions? Just ask! Quote
Malfunction Posted December 17, 2003 Author Posted December 17, 2003 (edited) THX my mistake was to think I could only add items to the toolbar via the button collection. I haven't tried to add the combobox directly to the toolbar. That's what I get for using the form designer. :D Edited December 17, 2003 by Malfunction Quote Debug me...
Malfunction Posted December 19, 2003 Author Posted December 19, 2003 (edited) Now it's getting funny... As you know I'm using VSN. The buttons are added by the Buttons collection (dialog) of that toolbar. The comboBox is added manually. The next problem is that I can't position the buttons added to the Buttons collection. So I end up having all the buttons to the left and the comboBox to their right. How can I position the comboBox to the left or in between two buttons? Is it possible when using the Buttons collection or do I have to do add everything manually? THX so far....... I've just discovered that the ComboBox is actually not added to the ToolBar but placed on top of it. :rolleyes: So how do I generally add stuff to a ToolBar in VSN? Edited December 19, 2003 by Malfunction Quote Debug me...
Leaders dynamic_sysop Posted December 19, 2003 Leaders Posted December 19, 2003 ToolBar.Controls.Add( your control ) Quote
Malfunction Posted December 19, 2003 Author Posted December 19, 2003 ToolBar.Controls.Add( your control ) ;) I knew that....so I can only do it dynamically not in the froms designer? If yes the toolbar can generally not be created in the forms designer when containing anything besides buttons in the toolbars' Buttons collection. Quote Debug me...
*Gurus* divil Posted December 19, 2003 *Gurus* Posted December 19, 2003 Voca, what is this System.Windows.Forms.ReBar of which you speak? Windows forms does not have a rebar control. Malfunction; the standard toolbar is very limited in what it can do - if you want it to display anything other than normal buttons and separators you're out of luck, you'll have to implement it manually. There are many good third-party toolbar/menu replacements which have this functionality built in (like my own - see my signature). Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Malfunction Posted December 19, 2003 Author Posted December 19, 2003 .... the standard toolbar is very limited in what it can do - if you want it to display anything other than normal buttons and separators you're out of luck, you'll have to implement it manually..... Yeah that's just what I've been thinking :D Currently checking your link thx for your support. Quote Debug me...
Malfunction Posted December 19, 2003 Author Posted December 19, 2003 :o another nubee question: How do I make the sandbar available in the form designer's toolbox? There's no instruction in the liscence.txt or readme.txt. Quote Debug me...
*Gurus* divil Posted December 19, 2003 *Gurus* Posted December 19, 2003 Same way you add anything to your toolbox. Right-click it, select customize or add/remove, whatever is there. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Voca Posted December 19, 2003 Posted December 19, 2003 Voca, what is this System.Windows.Forms.ReBar of which you speak? Windows forms does not have a rebar control. Sorry, lost track of my Controls and Standardcontrols :p Rebar is simply a toolbar with some advanced features. Voca Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.