如何用api实现vb代码text1.seltext=....

bobbysz 2001-07-21 12:49:42
有点像输入法的实现方法,不要通过剪贴板。
...全文
98 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Chice_wxg 2001-07-21
  • 打赏
  • 举报
回复
又来晚了 :)
gameboy999 2001-07-21
  • 打赏
  • 举报
回复
也就是
sendmessage text1.hwnd,EM_SETSEL,nstart,nend
gameboy999 2001-07-21
  • 打赏
  • 举报
回复
sendmessage text1.hwnd,nstart,nendEM_SETSEL
An application sends an EM_SETSEL message to select a range of characters in an edit control.

EM_SETSEL
wParam = (WPARAM) (INT) nStart; // starting position
lParam = (LPARAM) (INT) nEnd; // ending position

Parameters
nStart
Value of wParam. Specifies the starting character position of the selection.
nEnd
Specifies the ending character position of the selection.
Return Values
This message does not return a value.

Remarks
In a rich edit control, if the selection is not entirely contained in the first 64K, use the message EM_EXSETSEL.

If the nStart parameter is 0 and the nEnd parameter is –1, all the text in the edit control is selected. If nStart is –1, any current selection is removed. The caret is placed at the end of the selection indicated by the greater of the two values nEnd and nStart.



1,488

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧