control color
-
can be change button color if yes plz send me code for his Please mail me
-
can be change button color if yes plz send me code for his Please mail me
-
can be change button color if yes plz send me code for his Please mail me
yogendra kaushik wrote:
can be change button color
Have a look on
CBitmapButton
class Knock out 't' from can't, You can if you think you can :cool: -
can be change button color if yes plz send me code for his Please mail me
you can derived CButton and use from WM_DRAWITEM of course you need to set OwnerDrae for button from property window_**
**_
whitesky
-
you can derived CButton and use from WM_DRAWITEM of course you need to set OwnerDrae for button from property window_**
**_
whitesky
I like to autosize the owner draw button depending upon the text that it load dynamically based on localization strings. so some strings are large than others. Keeping this I override DrawItem in the inherited class from CButton. (In below i tried unconditionally to increase the size at runtime, once it is achived, i think i can go ahead for resize code) The sample code is below void CMyGraphicButton::DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct) { CString cs; CString cslong; ASSERT(lpDrawItemStruct->CtlType == ODT_BUTTON); LPCTSTR lpszText = (LPCTSTR) lpDrawItemStruct->itemData; if (!lpszText || lpszText == (LPCTSTR)-1) { GetWindowText (cs); } else cs = lpszText; // now i m trying to resize , so let try to increase the size of button unconditioally // I get //lpDrawItemStruct>rcItem.left =0 //lpDrawItemStruct>rcItem.right =75 //lpDrawItemStruct>rcItem.top = 0 //lpDrawItemStruct>rcItem.bottom = 25 //As my button is on extreme right side of dialog so i tried to extend/increase the size of // button of the left side as follows lpDrawItemStruct>rcItem.left -= 25 ; // but the above causes the text to be moved on right side insead of resize/increase the //button size. Any idea or help is appriciated. Thanks Anil }
[AKS]