visual c++ - custom or subclass the group box control in vc++ -
how make group box/ static control subclass or custom control.
how group box / static controls count. can apply rounded corners group box/ static controls.
how make group box/ static control subclass or custom control.
derive class cbutton
. handle nm_customdraw
notification custom drawing. alternatively 1 use bs_ownerdraw
window style, mutually exclusive bs_groupbox
. when using nm_customdraw
original window style flags can kept.
note nm_customdraw
sent parent window, can reroute message handle in control class this:
begin_message_map(cmygroupbox, cbutton) on_notify_reflect(nm_customdraw, oncustomdraw) end_message_map()
the definition of oncustomdraw()
this:
void cmygroupbox::oncustomdraw(nmhdr* pnmhdr, lresult* presult) { auto pnmc = reinterpret_cast<nmcustomdraw*>( pnmhdr ); // query pnmc members , custom drawing documented on msdn. // assign result *presult. }
how group box / static controls count.
use enumchildwindows()
enumerate child windows. in callback call getclassname()
check if windows class "button" , call getwindowlong(hwnd, gwl_style)
check if bs_groupbox
flag set.
Comments
Post a Comment