2个回答
展开全部
先给你来段MSDN
CEdit::SetSel
Call this function to select a range of characters in an edit control.
void SetSel(
DWORD dwSelection,
BOOL bNoScroll = FALSE
);
void SetSel(
int nStartChar,
int nEndChar,
BOOL bNoScroll = FALSE
);
Parameters
dwSelection
Specifies the starting position in the low-order word and the ending position in the high-order word. If the low-order word is 0 and the high-order word is –1, all the text in the edit control is selected. If the low-order word is –1, any current selection is removed.
bNoScroll
Indicates whether the caret should be scrolled into view. If FALSE, the caret is scrolled into view. If TRUE, the caret is not scrolled into view.
nStartChar
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.
nEndChar
Specifies the ending position.
CEdit::SetSel
Call this function to select a range of characters in an edit control.
void SetSel(
DWORD dwSelection,
BOOL bNoScroll = FALSE
);
void SetSel(
int nStartChar,
int nEndChar,
BOOL bNoScroll = FALSE
);
Parameters
dwSelection
Specifies the starting position in the low-order word and the ending position in the high-order word. If the low-order word is 0 and the high-order word is –1, all the text in the edit control is selected. If the low-order word is –1, any current selection is removed.
bNoScroll
Indicates whether the caret should be scrolled into view. If FALSE, the caret is scrolled into view. If TRUE, the caret is not scrolled into view.
nStartChar
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.
nEndChar
Specifies the ending position.
追问
非常感谢
如果方便的话帮忙解释下ReplaceSel(str)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询