Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. No ToolBarButton images in runtime

No ToolBarButton images in runtime

Scheduled Pinned Locked Moved C#
helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Skynyrd
    wrote on last edited by
    #1

    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?

    H 1 Reply Last reply
    0
    • S Skynyrd

      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?

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Are you calling Application.DoEvents after Application.EnableVisualStyles and before Application.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]

      S 1 Reply Last reply
      0
      • H Heath Stewart

        Are you calling Application.DoEvents after Application.EnableVisualStyles and before Application.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]

        S Offline
        S Offline
        Skynyrd
        wrote on last edited by
        #3

        Thanks a lot Heath, that solved the problem :-D

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups