Thread: Transparent toolbar buttons

  1. #16
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    If this helps at all, if I switch my style from the Default XP style to another style with my program open, the toolbar is fine, but if I switch my style and then open my program, the toolbar buttons are transparent any more. I'm open for any suggestions that you have, but try to be more specific than get a certain color because I'm not sure what I need to be doing with that color.

  2. #17
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    More info:

    If I use RGB(236,233,216) as background color, it appears transparent for Default XP style
    If I use RGB(235,233,237) as background color, it appears transparent for Windows Classic and Media Center styles (the only other two styles I have that I can test it with).

    Is there a way to set what color is the transparent color? I've read that the top left color of a bitmap is the transparent color, but that isnt happening.

  3. #18
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Update:

    I load the bitmap using ImageList_LoadImage and then send the bitmap through the TB_SETIMAGELIST message and it appears transparent for every style I tried it on. The problem now is that the colors are duller than they are supposed to be.

  4. #19
    Registered User
    Join Date
    Aug 2004
    Posts
    193
    Update:

    Using LR_CREATEDIBSECTION as one of the flags worked. I have solved my own problem!!! Thanks for all your help though!!!

    EDIT:

    Here is my code if you have the same questions:

    Code:
    HIMAGELIST imageList = ImageList_LoadImage(hInst, MAKEINTRESOURCE(ID_BITMAP), 60, 0, CLR_DEFAULT, IMAGE_BITMAP, LR_CREATEDIBSECTION|LR_LOADTRANSPARENT); // 60 = width of each button image
    SendMessage(hTool, TB_SETIMAGELIST, 0, (LPARAM)imageList);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Toolbar Buttons...What am I doing wrong?
    By dcboy in forum Windows Programming
    Replies: 0
    Last Post: 04-17-2006, 08:26 PM
  2. getting buttons onto a floating toolbar
    By eth0 in forum Windows Programming
    Replies: 0
    Last Post: 03-16-2006, 05:45 AM
  3. getting toolbar buttons onto a window
    By eth0 in forum Windows Programming
    Replies: 4
    Last Post: 02-24-2006, 12:59 PM
  4. Clipart for Toolbar Buttons?
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 02-24-2006, 10:23 AM
  5. Toolbar Buttons
    By G'n'R in forum Windows Programming
    Replies: 2
    Last Post: 10-02-2003, 04:35 AM