pb中获取多行文本编辑框(mle控件)指定行的内容
来源:程序员人生 发布时间:2014-04-15 11:49:07 阅读次数:6594次
//API函数定义
[cpp] view plaincopy
function long SendMessage(ulong hWnd, uint msg, long wParam, ref string lParam) library "user32.dll" alias for "SendMessageA"
//取第row行的文本
[csharp] view plaincopy
constant long EM_GETLINE = 196
string ls
ulong length, row
row = 2 //取第几行
ls = space(1000)
length = SendMessage(handle(mle_1), EM_GETLINE, row - 1, ls) //row - 1表示取得第row行的文本,0为起始
ls = trim(ls)
messagebox("取第" + string(row) + "行", "文本内容:" + ls + "~r~n文本长度:" + string(length))
摘自 yyoinge的专栏 ,
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠