Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CEdit::FmtLines

Call this function to set the inclusion of soft line-break characters on or off within a multiple-line edit control.

BOOL FmtLines(
   BOOL bAddEOL 
);

Parameters

bAddEOL
Specifies whether soft line-break characters are to be inserted. A value of TRUE inserts the characters; a value of FALSE removes them.

Return Value

Nonzero if any formatting occurs; otherwise 0.

Remarks

A soft line break consists of two carriage returns and a linefeed inserted at the end of a line that is broken because of word wrapping. A hard line break consists of one carriage return and a linefeed. Lines that end with a hard line break are not affected by FmtLines.

Windows will only respond if the CEdit object is a multiple-line edit control.

FmtLines only affects the buffer returned by GetHandle and the text returned by WM_GETTEXT. It has no impact on the display of the text within the edit control.

For more information, see EM_FMTLINES in the Platform SDK.

Example

#ifdef _DEBUG
   // The pointer to my edit.
   extern CEdit* pmyEdit;
   CString strText;

   // Add soft line-break breaks.
   pmyEdit->FmtLines(TRUE);

   // Dump the text of the edit control.
   pmyEdit->GetWindowText(strText);
   afxDump << strText;

   // Remove soft line-break breaks.
   pmyEdit->FmtLines(FALSE);
#endif

See Also

CEdit Overview | Class Members | Hierarchy Chart | CEdit::GetHandle | CWnd::GetWindowText

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.