Setting Permanent Margins CEditView :: MFC

kuphryn

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

Thanks,
Kuphryn
 

Adrian Tung

Golden Member
Oct 10, 1999
1,370
1
0
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