Toolbar control

  • Thread starter Thread starter David Schwartz
  • Start date Start date
D

David Schwartz

Which toolbar control would you recommend for a VB.NET Windows Forms
application and why?

Thanks!
 
* "David Schwartz said:
Which toolbar control would you recommend for a VB.NET Windows Forms
application and why?

For a simple application, I would use the ToolBar control which can be
found in the toolbox.
 
As a quick test, I just added the ToolBar control to a form, added an
ImageList with a few images, added a few buttons to the ToolBar, assigning
each one a different image from the ImageList. The images appear on the
toolbar at design time, but when I run the application the buttons appear
without images. Is there something else I need to do to make the images
appear at run-time?

Thanks.
 
* "David Schwartz said:
As a quick test, I just added the ToolBar control to a form, added an
ImageList with a few images, added a few buttons to the ToolBar, assigning
each one a different image from the ImageList. The images appear on the
toolbar at design time, but when I run the application the buttons appear
without images. Is there something else I need to do to make the images
appear at run-time?

If you are using Windows XP Visual Styles, call 'Application.DoEvents'
directly after the call to 'Application.EnableVisualStyles'.
 
I don't have any call to EnableVisualStyles. (Actually there is no code at
all in my test application, just the controls). Do I need this call
somewhere?

Thanks.
 
I went thru the same thing with the ToolBar control. Look in Help and follow
the instructions there exactly as stated. It seems if you do any portion out
of order the images will show up in the designer but not at run-time. Sorry
I don't remember the exact order.
james

David Schwartz said:
As a quick test, I just added the ToolBar control to a form, added an
ImageList with a few images, added a few buttons to the ToolBar, assigning
each one a different image from the ImageList. The images appear on the
toolbar at design time, but when I run the application the buttons appear
without images. Is there something else I need to do to make the images
appear at run-time?

Thanks.
 
* "David Schwartz said:
I don't have any call to EnableVisualStyles. (Actually there is no code at
all in my test application, just the controls). Do I need this call
somewhere?

Which version of .NET do you use?
 
I just started over and followed the steps in the Help exactly in order.
Still the same result. Could anyone else please try this and see if they
have the same problem?

I guess I'm starting to see why a 3rd party control would make sense as
opposed to Microsoft's buggy free control!

Thanks.

james said:
I went thru the same thing with the ToolBar control. Look in Help and follow
the instructions there exactly as stated. It seems if you do any portion out
of order the images will show up in the designer but not at run-time. Sorry
I don't remember the exact order.
james
 
Any ideas? I'd like to be able to use this control, but I'm kind of stuck
at this point...

Thanks in advance.

David Schwartz said:
As a quick test, I just added the ToolBar control to a form, added an
ImageList with a few images, added a few buttons to the ToolBar, assigning
each one a different image from the ImageList. The images appear on the
toolbar at design time, but when I run the application the buttons appear
without images. Is there something else I need to do to make the images
appear at run-time?

Thanks.
 
Any ideas?

I just set the properties in Form_Load, and I have never had any problem.
Me.ToolBar1.ImageList = imglstToolbar
ToolBar1.Buttons(0).ImageIndex = 0
ToolBar1.Buttons(1).ImageIndex = 1
ToolBar1.Buttons(2).ImageIndex = 2
 
I finally managed to get it to work by doing the following at design time:
change the form backcolor to white, change the form backcolor back to the
default value of Control. Once I did this, the images magically appeared on
my form at runtime.

It's amazing that I'm the only one in the VB.Net world to have experienced
this! Oh well, I guess there's something to be said for being unique.
 
Back
Top