程序员人生 网站导航

pb中获取多行文本编辑框(mle控件)指定行的内容

栏目:sybase时间:2014-04-15 11:49:07
//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的专栏 ,
------分隔线----------------------------
------分隔线----------------------------

最新技术推荐