
VC++ dynamically add/remove CEdit borders
Quote:
>I need to dynamically highlight / un-highlight CEdit controls, preferrably
>by adding / removing the borders.
>I have tried CWnd::ModifyStyle and ModifyStyleEx with no effect.
>Please tell me how to add remove borders to/from a CEdit control without
>re-creating it.
Chuck,
Make sure you specify SWP_DRAWFRAME when you use ModifyStyle:
CEdit * pEd = static_cast<CEdit *>(GetDlgItem( IDC_EDIT1 ) );
pEd->ModifyStyleEx( WS_EX_CLIENTEDGE, 0, SWP_DRAWFRAME );
It depends what styles you're trying to change - many controls allow
you to change their style at run-time, but don't take any notice of
the changes - they only take effect when the control is created.
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.