-
April 4th, 2006, 07:36 AM
#1
[RESOLVED] Set "Owner Draw" property in the constructor
Hi,
I'm looking how to set the "Owner Draw" property in the construtor
Thanks helping me.
-
April 4th, 2006, 07:45 AM
#2
Re: Set "Owner Draw" property in the constructor
What "construtor"? What class? What control? ...?
-
April 4th, 2006, 07:52 AM
#3
Re: Set "Owner Draw" property in the constructor
It's a customed class based on CBitmapButton.
It needs that all components herited from its to have "Owner Draw" property to true
So i want to do this in it's constructor
-
April 4th, 2006, 08:01 AM
#4
Re: Set "Owner Draw" property in the constructor
I guess CBitmapButton uses the "BUTTON" window class. In that case you would have to set the window style BS_OWNERDRAW. SetWindowLong() is the function you can use for this task. Of course you will also need to use GetWindowLong() because you add the window style.
Please don't forget to rate users who helped you!
-
April 4th, 2006, 08:11 AM
#5
Re: Set "Owner Draw" property in the constructor
I don't think you can set the style in the constructor because the window is not actually a 'window' at that point in time. A better place would be in PreSubclassWindow() using CWnd::ModifyStyle().
Gort...Klaatu, Barada Nikto!
-
April 4th, 2006, 08:17 AM
#6
Re: Set "Owner Draw" property in the constructor
Originally Posted by Mike Harnad
I don't think you can set the style in the constructor because the window is not actually a 'window' at that point in time. A better place would be in PreSubclassWindow() using CWnd::ModifyStyle().
Ok, but wich style adding ?
I don't see Owner draw in style list
-
April 4th, 2006, 08:21 AM
#7
Re: Set "Owner Draw" property in the constructor
CWnd::ModifyStyle() will allow you to specify control styles also. So, simply specify BS_OWNERDRAW.
Gort...Klaatu, Barada Nikto!
-
April 4th, 2006, 08:25 AM
#8
Re: Set "Owner Draw" property in the constructor
Thanks, it's good !
this->ModifyStyle(0, BS_OWNERDRAW);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|