No ToolBarButton images in runtime
-
When I enable VisualStyles in my Application I loose all the images on all the toolbarbuttons of my app in runtime. The problem is solved when I disable visualstyles. This only happens in runtime as I can see the images perfectly in the designer. I'm currently using bmps 24x24 pixels and 24 BPP. Transparent color of the ImageList is set to White. Anybody knows why this is happening?
-
When I enable VisualStyles in my Application I loose all the images on all the toolbarbuttons of my app in runtime. The problem is solved when I disable visualstyles. This only happens in runtime as I can see the images perfectly in the designer. I'm currently using bmps 24x24 pixels and 24 BPP. Transparent color of the ImageList is set to White. Anybody knows why this is happening?
Are you calling
Application.DoEvents
afterApplication.EnableVisualStyles
and beforeApplication.Run
? If you don't, problem like this will arise due to timing issues. A bare-bones entry-point should look like this (for example):static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new Form1());
}This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]
-
Are you calling
Application.DoEvents
afterApplication.EnableVisualStyles
and beforeApplication.Run
? If you don't, problem like this will arise due to timing issues. A bare-bones entry-point should look like this (for example):static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new Form1());
}This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]