Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Button transparent background problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Button transparent background problem

 Post Reply Post Reply
Author
Message Reverse Sort Order
miatu View Drop Down
Newbie
Newbie


Joined: 07 May 2008
Location: Ukraine
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote miatu Quote  Post ReplyReply Direct Link To This Post Topic: Button transparent background problem
    Posted: 05 October 2010 at 3:12pm
Thank You very much. This helps
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2010 at 7:10am
Hi,

Please create Brush from your birmap and return it in CtlColor instead of HOLLOW_BRUSH.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
miatu View Drop Down
Newbie
Newbie


Joined: 07 May 2008
Location: Ukraine
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote miatu Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2010 at 11:29am
Hi. I have a problem with button transparent background. I have a dialog based application. I draw background on it. When i use skin i have black background under radio button and checkbox(view attach). When i don't use style all is ok. Help, please.

XTPSkinManager()->LoadSkin(L"\\Styles\\iTunes", L"Normalitunes.INI");

For buttons i use this class:

class TransparentButton : public CButton
{
DECLARE_DYNAMIC(TransparentButton)

protected:
DECLARE_MESSAGE_MAP()

public:
afx_msg HBRUSH CtlColor(CDC* dc, UINT ctlColor);
afx_msg BOOL OnEraseBkgnd(CDC* dc);
};

IMPLEMENT_DYNAMIC(TransparentButton, CButton)

BEGIN_MESSAGE_MAP(TransparentButton, CButton)
   ON_WM_CTLCOLOR_REFLECT()
   ON_WM_ERASEBKGND()
END_MESSAGE_MAP()

HBRUSH TransparentButton::CtlColor(CDC* dc, UINT ctlColor)
{
   dc->SetBkMode(TRANSPARENT);
   return (HBRUSH)GetStockObject(HOLLOW_BRUSH);
}

BOOL TransparentButton::OnEraseBkgnd(CDC* dc)
{
return TRUE;
}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.