Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

Toolbar images don't display

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael J. Salamone - 06 Aug 2005 04:09 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.