• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Setting Permanent Margins CEditView :: MFC

kuphryn

Senior member
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:😱nEnSetfocus()
{
CEdit &rE = GetEditCtrl();
DWORD dwMargins = rE.GetMargins();
rE.SetMargins(3, HIWORD(dwMargins))
...
}
-----

Thanks,
Kuphryn
 
If you're using the doc/view architecture, you can override OnInitialUpdate which belongs to CView and place your margin code there.


Hope that helps,
🙂atwl
 
Back
Top