I have some strange behavior with toolbar images - will do my best to
describe - hope someone can help!
I have several toolbars in my application. I assign each toolbar button an
image at design time - and they all display correctly in the designer.
However, when I run the program, some toolbar images are displayed, and
others are "blank" - no image displayed. The tooltips do display, though.
On each toolbar, either all the images are displayed correctly, or all are
blank.
The main form has several tabs. Each tab has associated listviews,
treeviews, etc - and toolbars. When the app starts, there is code to
restore splitters and column widths settings for each listview.
On the particular tab that has the problem, the preferences are restored
after the call to InitializeComponent(). If, immediately after the call to
restore preferences I add a message box, all the toolbar images are
displayed correctly. Without even changing the code - just breaking on the
call to MessageBox, and then setting the instruction pointer immediately
after it - no toolbar images :( If I execute the MessageBox statement -
voila - toolbar images!
It's a bit bizarre, and I'm not sure where to go with it. I'd appreciate
any suggestions on things to check, a good strategy to debug, or even just a
way to narrow down the problem!
This is how the code goes:
InitializeComponent();
EnableDisableControls(); // disables or enables controls - including
toolbars
RestorePreferences(); // restore listview column widths, splitters
MessageBox();
I've tried skipping both EnableDisableControls and RestorePreferences
calls - to no avail. It's the call to MessageBox() that seems to be the
magic bullet.

Signature
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
Neno Loje [MVP C#] - 06 Aug 2005 12:40 GMT
Are you using Windows XP Themes?

Signature
Neno Loje [MVP C#]
http://www.dotnet-online.com
>I have some strange behavior with toolbar images - will do my best to
>describe - hope someone can help!
[quoted text clipped - 35 lines]
> calls - to no avail. It's the call to MessageBox() that seems to be the
> magic bullet.
Michael J. Salamone - 06 Aug 2005 14:57 GMT
Yes.

Signature
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
> Are you using Windows XP Themes?
>
[quoted text clipped - 38 lines]
>> calls - to no avail. It's the call to MessageBox() that seems to be the
>> magic bullet.
Michael J. Salamone - 06 Aug 2005 15:29 GMT
Yes, but it doesn't seem to be related to that.
I have a .manifest file (contents below). If I rename the file such that it
doesn't apply the XP themes, the same problem occurs.
.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Winweb.nyapp.exe"
type="win32"
/>
<description>myapp</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
> Are you using Windows XP Themes?
>
[quoted text clipped - 38 lines]
>> calls - to no avail. It's the call to MessageBox() that seems to be the
>> magic bullet.
Michael J. Salamone - 07 Aug 2005 00:59 GMT
I should have checked out the MS Knowledge Base first (and a long time ago).
Turns out this one was in there!
http://support.microsoft.com/default.aspx?scid=kb;en-us;327154

Signature
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
>I have some strange behavior with toolbar images - will do my best to
>describe - hope someone can help!
[quoted text clipped - 35 lines]
> calls - to no avail. It's the call to MessageBox() that seems to be the
> magic bullet.