pb中獲取多行文本編輯框(mle控件)指定行的內(nèi)容
來源:程序員人生 發(fā)布時間:2014-04-15 11:49:07 閱讀次數(shù):6828次
//API函數(shù)定義
[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) + "行", "文本內(nèi)容:" + ls + "~r~n文本長度:" + string(length))
摘自 yyoinge的專欄 ,
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學習有所幫助,可以手機掃描二維碼進行捐贈