Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTPButton and BS_ICON
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPButton and BS_ICON

 Post Reply Post Reply
Author
Message
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Topic: CXTPButton and BS_ICON
    Posted: 09 September 2008 at 12:55pm
I want to have some radio buttons with icons instead of text - I set the BS_ICON style on the control and called SetIcon() in my dialog app, but nothing happened.  I changed the variable type to CButton and my icon appeared, but I get no alpha channel. 
 
I added BS_ICON to the icons in the "controls" sample and get no icon there, either.  I couldn't find any samples that even had BS_ICON, so I'm curious --- How do I do that?
 
Thanks!
 
- David
 
<Late Afternoon Update>
 
I got it to draw an icon, but only one with BS_ICON | BS_PUSHLIKE defined and loaded with
 

HICON hIcon = ::LoadIcon(iconInst,MAKEINTRESOURCE(iconIds[x].icon));

BOOL bFoundIcon = (hIcon ? TRUE : FALSE);

CXTPButton* button = (CXTPButton*)GetDlgItem(iconIds[x].cmd);

if(button && button->GetSafeHwnd())

{

if(bFoundIcon)

button->SetIcon(sz32,hIcon);

}
// other code deleted...
 
 and not when loaded with
 

CXTPImageManagerIconHandle hIcon;

BOOL bFoundIcon = hIcon.CreateIconFromResource(iconInst,MAKEINTRESOURCE(iconIds[x].icon),sz32, TRUE)

// seticon code same as above....
I'd really like to remove the BS_PUSHLIKE flag so I could get a radio button with an icon beside it.
Any ideas?
 
- Thanks!
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.125 seconds.