首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

RICHEDIT控件的选中是什么咋回事

2012-03-12 
RICHEDIT控件的选中是什么怎么回事?我的调用SetParaFormat()设置,但是我根本就没有选中任何一行,但是在里

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



难道默认的是选中全部?

[解决办法]
SetParaFormat应该是设置段落格式,所以跟你选没选中无关
取消全选的话,去查查SetSel的2个参数是干嘛的
[解决办法]
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);
[解决办法]
The selection includes everything if the beginning (cpMin or nStartChar) is 0 and the end (cpMax or nEndChar) is – 1.

热点排行