Поделиться через


CEditView::GetEditCtrl

Call GetEditCtrl to get a reference to the edit control used by the edit view.

CEdit& GetEditCtrl( ) const;

Возвращаемое значение

A reference to a CEdit object.

Заметки

This control is of type CEdit, so you can manipulate the Windows edit control directly using the CEdit member functions.

Предупреждающее замечаниеВнимание!

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.

Пример

void CMyEditView::OnInitialUpdate()
{
   CEditView::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);
}

Требования

Header: afxext.h

См. также

Основные понятия

CEditView Class

CEditView Members

Hierarchy Chart

CEdit Class

CEditView::SetTabStops