Missing toolbar icons in print preview dialog

Hello,

 I'm developing a C# application. Initially I had a Windows.Form object with (among other members) a PrintPreviewDialog data member, and this dialog worked just fine: all the toolbar buttons in the print preview dialog displayed the icons correctly. Then I added a Toolbar and an ImageList object to my form, added two .ico files to the ImageList object, and associated the toolbar buttons with the items of the ImageList object. I thought everything was fine because the icons in the toolbar buttons appeared immediately in the development environment. Then I ran the program, and neither the toolbar buttons of my form, nor the toolbar buttons in the preview dialog were displayed. The buttons themselves were actually on the toolbar, they were fully functional, but for some reason, the images were not drawn in the buttons. When I removed the Toolbar and the ImageList objects from my form, the print preview dialog displayed its toolbar buttons correctly again.

  Each icon file contains a 16*16/16 and a 16*16/256 color icon. I tried to set the ColorDepth property of the ImageList object to 4bit and 8 bit, but neither worked.

  Can you give me any help

Thank You
Peter


Answer this question

Missing toolbar icons in print preview dialog

  • Hu Xinrui

    I dont use EnableVisualStyles(), and still have the same problem.
    No icons in toolbar buttons in PrintPreviewDialog.
    Here is the screenshot:
    http://www.brandbit.com/images/PrintPreviewBug.JPG
    Please help

  • Netmaker

    Are you using EnableVisualStyles()  If so, check out this thread: <a href="http://www.windowsforms.net/Forums/ShowPost.aspx tabIndex=1&tabId=41&PostID=18974">EnableVisualStyles and NotifyIcon bug</a>
  • Slappie

    Yes, I'm using EnableVisualStyles(), and the thread you specified was very much helpful! Thank You!
  • Dan Yerex

    No one can help me
  • Missing toolbar icons in print preview dialog