共用方式為


CRichEditCtrl::Clear

Deletes (clears) the current selection (if any) in the rich edit control.

void Clear( );

Remarks

The deletion performed by Clear can be undone by calling the Undo member function.

To delete the current selection and place the deleted contents onto the Clipboard, call the Cut member function.

For more information, see WM_CLEAR in the Windows SDK.

Example

// Delete all of the text.
m_myRichEditCtrl.SetSel(0, -1);
m_myRichEditCtrl.Clear();

Requirements

Header: afxcmn.h

See Also

Reference

CRichEditCtrl Class

Hierarchy Chart

CRichEditCtrl::Undo

CRichEditCtrl::Cut

CRichEditCtrl::Copy

CRichEditCtrl::Paste

Other Resources

CRichEditCtrl Members