Jump to content
  • Advertisement


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


Setting Permanent Margins CEditView :: MFC

This topic is 5916 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!