Hi,
I'm looking how to set the "Owner Draw" property in the construtor
Thanks helping me.
Printable View
Hi,
I'm looking how to set the "Owner Draw" property in the construtor
Thanks helping me.
What "construtor"? What class? What control? ...?
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
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.
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 ?Quote:
Originally Posted by Mike Harnad
I don't see Owner draw in style list
CWnd::ModifyStyle() will allow you to specify control styles also. So, simply specify BS_OWNERDRAW.
Thanks, it's good !
this->ModifyStyle(0, BS_OWNERDRAW);
:cool: