主题:又关获取文本框文字行数的问题
luo1353167
[专家分:0] 发布于 2008-10-01 11:38:00
[size=3] 这是一个有关获取文本框文字行数的问题,我在网上查了好久都么查到,也许是太简单的问题吧,我很想知道怎么样做,请高手指教!!![em1[/size]]
回复列表 (共1个回复)
沙发
snyga [专家分:1480] 发布于 2008-10-01 16:54:00
傻瓜版:
sub form_load()
msgbox ubound(split(text1.text,vbcrlf))+1
end sub
API版:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_GETLINECOUNT = &HBA
sub form_load()
msgbox sendmessage(text1.hwnd, EM_GETLINECOUNT, 0, 0)
end sub
我来回复