Print Page | Close Window

CXTPButton and BS_ICON

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=12117
Printed Date: 16 May 2024 at 2:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPButton and BS_ICON
Posted By: ddlittle
Subject: CXTPButton and BS_ICON
Date 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!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net