CEditView::GetEditCtrl

CEdit& GetEditCtrl( ) const;

Return Value

A reference to a CEdit object.

Remarks

Call GetEditCtrl to get a reference to the edit control used by the edit view. This control is of type CEdit, so you can manipulate the Windows edit control directly using the CEdit member functions.

! WARNING   Using the CEdit object can change the state of the underlying Windows edit control. For example, you should not change the tab settings using the CEdit::SetTabStops function because CEditView caches these settings for use both in the edit control and in printing. Instead, use CEditView::SetTabStops.

Example

CMyEditView::OnInitialUpdate()
{
   // get the edit control and set some initial properties for it
   CEdit& theEdit = GetEditCtrl();

   // adjust the left margin without changing the right margin
   DWORD dwMargins = theEdit.GetMargins();
   theEdit.SetMargins(20, HIWORD(dwMargins));

   // only accept 10k of text
   theEdit.SetLimitText(10 * 1024);
}

CEditView OverviewClass MembersHierarchy Chart

See Also   CEdit, CEditView::SetTabStops