void SetSel(
int nStartChar,
int nEndChar,
BOOL bNoScroll = FALSE
);
nStartChar //参数说明不是 -1开始是选择当前删除吗????
Specifies the starting position. If nStartChar is 0 and nEndChar is –1, all the text in the edit control is selected. If nStartChar is –1, any current selection is removed.
Example
// The pointer to my edit.
extern CEdit* pmyEdit;// Delete all of the text.
pmyEdit->SetSel(0, -1);
pmyEdit->Clear();
int nStartChar,
int nEndChar,
BOOL bNoScroll = FALSE
);
nStartChar //参数说明不是 -1开始是选择当前删除吗????
Specifies the starting position. If nStartChar is 0 and nEndChar is –1, all the text in the edit control is selected. If nStartChar is –1, any current selection is removed.
Example
// The pointer to my edit.
extern CEdit* pmyEdit;// Delete all of the text.
pmyEdit->SetSel(0, -1);
pmyEdit->Clear();
取消选择是 SetSel(-1, 0)
SetSel(-1, -1)//是啥意思呢。
nStartChar就是低位,nEndChar就是高位。
nStartChar就是低位,nEndChar就是高位。
nStartChar就是低位,nEndChar就是高位。
如果编译器不报错的话,跟SetSel(-1, 0)是一样的,取消当前选定内容。但有可能nEndChar不能设置为-1
nStartChar就是低位,nEndChar就是高位。
如果编译器不报错的话,跟SetSel(-1, 0)是一样的,取消当前选定内容。但有可能nEndChar不能设置为-1
//下面代码是在文本框,输入10行内容 + 换行
for(int i = 0 ;i< 10 ;i++) //不太理解 取消当前选择 是什么意思??? 不太理解
{
((CEdit*)GetDlgItem(IDC_EDIT_INFORMATION))->SetSel(-1,-1);
((CEdit*)GetDlgItem(IDC_EDIT_INFORMATION))->ReplaceSel(m_Field_Operate[i].strValue+_T("\r\n"));
}
哥,我在八楼已经跟你说了...
你看清楚了:(0,-1)是全选;(-1,0)是取消当前的选择,那么如果(-1,-1)编译通过的话,应该是跟(-1,0)是一样的作用,是取消当前选择!!!