![]() |
Problem getting themed buttons to look correct |
Post Reply
|
| Author | |
Enclaved Shadow
Groupie
Joined: 22 August 2006 Location: Canada Status: Offline Points: 31 |
Post Options
Thanks(0)
Quote Reply
Topic: Problem getting themed buttons to look correctPosted: 29 August 2006 at 10:45am |
|
I have a dialog with a bunch of buttons on it. Two of the buttons have member variables. I cannot seem to get these two buttons to look the same as the other buttons that do not have member variables.
Here is a small snapshot of the buttons in question:
The button that is highlighted in orage and button with the bitmap (rightmost second row) are the two buttons with CXTButton member vars.
I have the following code in the dialog's OnInit() method:
Not too sure what's going on here. I've tried several combinations of setting the individual button's theme, using different themes and I can't get them to look correct. Any clues to what I am doing wrong?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 August 2006 at 10:59am |
|
Hi,
If you want them look like standard just use standard CButton class instead CXTButton...
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Enclaved Shadow
Groupie
Joined: 22 August 2006 Location: Canada Status: Offline Points: 31 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 August 2006 at 3:05pm |
|
I made them regular CButton's and that solved part of the problem. The other problem is that I want to use a bitmap on one of the buttons. In order to do that I need to set the OwnerDraw property.
Owner Draw TRUE:
Owner Draw FALSE:
What I'm looking for is the combination of the two ... where the button still has the XP theme and the bitmap on top of it. I have tried using CButton and CBitmapButton member vars and get the same result with both. With the CBitmapButton I am just using the following one liner in the OnInit():
|
|
![]() |
|
Barto
Groupie
Joined: 27 February 2005 Location: Germany Status: Offline Points: 60 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 August 2006 at 5:13am |
|
m_wScanImport.SetXButtonStyle(BS_XT_WINXP_COMPAT);
worked for me.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 August 2006 at 8:42am |
|
Hi,
Yes m_wScanImport.SetXButtonStyle(BS_XT_WINXP_COMPAT) have to work...
Also if you want standard CButton with bitmap check CButton::SetBitmap method.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Enclaved Shadow
Groupie
Joined: 22 August 2006 Location: Canada Status: Offline Points: 31 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 September 2006 at 11:12am |
|
I got a little side tracked last week but am back to this again ... so I swaped the CButton back in, changed the owner draw property to FALSE, and changed the init code to the following:
Now the output looks like:
The button is there and the bitmap is being displayed but themes are once again not working with that button. Is there something I'm missing?
|
|
![]() |
|
Enclaved Shadow
Groupie
Joined: 22 August 2006 Location: Canada Status: Offline Points: 31 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 September 2006 at 11:57am |
|
Finally fixed the problem myself. I had to change the CButton back to a CXButton and added the following member variables:
then modified changed some code in the OnInit method to look like the following:
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |