CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Whcih paint message to catch for TreeView Ctrl

    Hi*!
    I am creating a TreeView Control at run time by using createwindow. I am want the TreeView to be drawn transparently so that i can show a bitmap that the main window contains. I am thinking of Doing something like
    PHP Code:
    SetBkMode(handleto_treeCtrlTRANPARENT);
    return 
    /* creating an returning with a NULL brush to draw the background */
    Please correct me if i am wrong. My problem is find the message that the control gets before it starts drwaing. I sraeched for something like WM_CTRLCLR** but there isn't anything for the treeview ctrl. I am using Win32 not MFC.
    Secondly if there is another way to draw TreeView Ctrl transparently plz DO tell me. I'll be oblighed.
    Regards,
    Usman.

  2. #2
    Join Date
    May 2000
    Location
    Toronto, ON, Canada
    Posts
    3,573
    Hi Usman,

    Look at
    Code:
    COLORREF TreeView_SetBkColor(
        HWND hwndTV 
        COLORREF clrBk;
    );
    Regards,

    Emanuel Vaduva

  3. #3
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384
    Thanks Emi for your reply. The problem is i don't want to set the background color to any other color. I want to make the TreeView background TRANSPARENT so that the window containg the treeview showsup. I am displaying a bitmap at the main window.
    Thanks,
    Usman.

  4. #4
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384
    Hi!!!!!!!

  5. #5
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    Have a look at this article. It does not exactly draw a CTreeCtrl with a transparent background, but with a background bitmap, maybe this will fit your needs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured