Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Problems goig from CXTButton to CXTPButton
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problems goig from CXTButton to CXTPButton

 Post Reply Post Reply
Author
Message
eggbox View Drop Down
Groupie
Groupie
Avatar

Joined: 10 March 2006
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote eggbox Quote  Post ReplyReply Direct Link To This Post Topic: Problems goig from CXTButton to CXTPButton
    Posted: 19 January 2018 at 12:38pm
We recently upgraded to version 18.2 from 17.2 and we are looking at code that uses CXTButton and would like to upgrade to CXTPButton since the former is deprecated.

The code in question creates a button and as a flat button style with an image, with no code changes the button does not show the image at all.

Some code (rcButtonPos and pParent are set correctly)

-----
CXTPButton btn;
btn.Create(_T(""), WS_CHILD|BS_NOTIFY|WS_VISIBLE|WS_TABSTOP, rcButtonPos, pParent, 100);
btn.SetButtonStyle(BS_XT_SEMIFLAT|BS_XT_SHOWFOCUS );
CBitmap bitmap; 
bitmap.LoadBitmap(uID);  // Load image from resources
CSize size = bitmap.GetBitmapDimension(); 
btn.SetBitmap(size, uID);
-----
It seems like I am doing everything correctly but all get is the default button images, e.g.


Does anyone have an idea of what I am doing wrong?
Thanks in advance.
//*eggbox

Product: Xtreme ToolkitPro v18.2.0
Platform: Windows 7 (32 bit)
Language: C++ / MFC
Back to Top
cluster View Drop Down
Groupie
Groupie


Joined: 22 January 2015
Status: Offline
Points: 91
Post Options Post Options   Thanks (0) Thanks(0)   Quote cluster Quote  Post ReplyReply Direct Link To This Post Posted: 20 January 2018 at 7:17am
Hi

i think you should try:
btn.SetBitmap(size/3uID);
Windows 7
Visual Studio 2013
CodeJock 18.6
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.188 seconds.