OnPaint vr. DrawItem
-
Hi, I'm currently creating a lot of ownerdrawn MFC-controls. Can anybody tell why i should use DrawItem() instead of OnPaint()?
for many controls, DrawItem will give you information about the specific sub-item (menu choice, list box item, etc) that you need to draw. OnPaint is for the control as a whole. for controls that don't have sub-items, there's not much difference between the two (buttons, etc) Cleek | Image Toolkits | Thumbnail maker
-
for many controls, DrawItem will give you information about the specific sub-item (menu choice, list box item, etc) that you need to draw. OnPaint is for the control as a whole. for controls that don't have sub-items, there's not much difference between the two (buttons, etc) Cleek | Image Toolkits | Thumbnail maker
Chris Losinger wrote:
for controls that don't have sub-items, there's not much difference between the two (buttons, etc)
For buttons, DrawItem provides provides a lot of info that OnPaint does not, such as selection and focus state, and whether the button is up, down, disabled, ect.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
-
Chris Losinger wrote:
for controls that don't have sub-items, there's not much difference between the two (buttons, etc)
For buttons, DrawItem provides provides a lot of info that OnPaint does not, such as selection and focus state, and whether the button is up, down, disabled, ect.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
ah yeah. forgot about that.. been a long time... Cleek | Image Toolkits | Thumbnail maker