-
February 27th, 2004, 12:30 PM
#1
Owner-Draw Combo + CBitmapButton on the same dialog
Hello!
I have an owner drawn combobox on a dialog managed via the function "void CMyDialogDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)" and everything works fine.
But when on the same dialog I place CBitmapButton, the button doesn't get drawn!
I think the subclassing of the bitmapbutton generates a conflict with the OnDrawItem, but I don't know how to workaround this problem!
Is someone enogh brave to help me?
++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
God does not play dice with the universe.(A.Einstein)
-
February 27th, 2004, 01:13 PM
#2
Re: Owner-Draw Combo + CBitmapButton on the same dialog
Originally posted by Andrea_Rossini
I think the subclassing of the bitmapbutton generates a conflict with the OnDrawItem, but I don't know how to workaround this problem!
Difficult to say without seeing any code... Are you calling the base class implementation of OnDrawItem()? What are you doing if the the value of the nIDCtl parameter is not that of your combobox?
-
February 28th, 2004, 02:52 AM
#3
I check the id of the combo on the standard overridden OnDrawItem and I call CDialog::OnDrawItem by default. (removed because of an assertion).
Anyway the CBitmapButton is used like always (loadbitmaps at startup and nothing else).
The problem is I don't have the code now. I'll be in office next week, and I'll send you my code... (if i don't solve everything by myself)
thanks for the interest.
++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
God does not play dice with the universe.(A.Einstein)
-
March 1st, 2004, 02:41 AM
#4
Done !
I Subclassed the combo this way:
class CMyCombo : public CComboBox
overriding the DrawItem member, then I associated an object of this custom class to the control in the dialog.
Another question:
how do I MeasureItem depending on the font of the Combo????
++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----.
God does not play dice with the universe.(A.Einstein)
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
|