+ -
当前位置:首页 → 问答吧 → RICHEDIT控件的选中是什么怎么回事?

RICHEDIT控件的选中是什么怎么回事?

时间:2011-12-07

来源:互联网

我的调用SetParaFormat()设置,但是我根本就没有选中任何一行,但是在里面显示的字体还是有效果呢?



难道默认的是选中全部?

作者: qweewqpkn   发布时间: 2011-12-07

SendMessage(EM_SETSEL,-1, -1);
与SetSel(-1,-1);


效果都是一样吗? 都是让richedit取消全选?

作者: qweewqpkn   发布时间: 2011-12-07

SetParaFormat应该是设置段落格式,所以跟你选没选中无关
取消全选的话,去查查SetSel的2个参数是干嘛的

作者: Me_Not_You   发布时间: 2011-12-08

void SetSel( long nStartChar, long nEndChar );

nStartChar

Zero-based index of the first character for the selection.//首个字符的索引值

nEndChar

Zero-based index of the last character for the selection.//末尾字符的索引值


To select all the text in this CRichEditCtrl object, call SetSel with a start index of 0 and an end index of – 1//全选就是SetSel(0,-1);

作者: Me_Not_You   发布时间: 2011-12-08

热门下载

更多