Archived

This topic is now archived and is closed to further replies.

kuphryn

Setting Permanent Margins CEditView :: MFC

Recommended Posts

Hi. Is there a way to set the margins in a CEditView view class to stay permanent? In the program I am working on, I can set the margin in OnEnSetFocus, however, if the user starts a new document, the margin resets to its default. The default margin makes it difficult for the user to see where the text being since it is so close to the left wall of the frame. Here is the code I use to set the margin in OnEnSetFocus: ----- void CMyAppView::OnEnSetfocus() { CEdit &rE = GetEditCtrl(); DWORD dwMargins = rE.GetMargins(); rE.SetMargins(3, HIWORD(dwMargins)) ... } ----- Thanks, Kuphryn

Share this post


Link to post
Share on other sites
You''ll have to set it in a localized location outside of the view/doc/frame and then when your view get''s created, get the default value and set it on OnCreate or something.

Good luck.

Take a peek at MFC Internals. Good book.

Share this post


Link to post
Share on other sites