简体   繁体   中英

How to show caret in a disabled MFC CEdit control?

If an edit control is disabled, the caret disappears. that case, if the edit is displaying a long text, then it is not possible to see the rest of the words.With the caret i, we can do that.

I think you must use an enabled readonly edit control instead of a disabled one.

Check 'readonly' in the edit box property window or use ES_READONLY when calling Create . Also, don't forget to check Auto HScroll ( ES_AUTOHSCROLL ) ( and AutoVScroll if multiline).

CEdit* pEdit = new CEdit;
pEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER
  | ES_AUTOHSCROLL | ES_READONLY, (10, 10, 100, 100), this, 1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM