What don't my Toolbar icons display?

When i run my VB.NET application the icons in the ToolBar control always don't appear although they
function correctly.
What can I do to resolve this problem?

[170 byte] By [safi_h80] at [2007-12-16]
# 1
Hi,
Are you using toolbar or toolstrip control?
If toolbar, try changing the images and size of the images in the imagelist control and see if it happens again...
I was having that kind of problem, I just changed the picture, and it suddenly stopped happening... Kinda weird...
cheers,
Paul June A. Domag
PaulDomag at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
Are you using .NET Framework 1.1? If so, then there is a bug if you have a Main similar to this:


private static void Main()
{
Application.EnableVisualStyles();

Application.Run(new MainForm());
}

What you need to do is place Application.DoEvents() after the EnabledVisualStyles() call, like so:


private static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();

Application.Run(new MainForm());
}

This should fix the problem. Note that this has been fixed in .NET Framework 2.0.

DavidM.Kean at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified