# Re: 如何可以快速取得文字档的行数呢??

Posted by j on October 17, 1999 at 11:09:14:

In Reply to: 如何可以快速取得文字档的行数呢?? posted by JR on October 17, 1999 at 00:16:45:

: 如何可以快速取得文字档的行数呢??

先把文字档开启，然后放在 Text1 内

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

Dim N As Long

N = SendMessage(Text1.hwnd, EM_GETLINECOUNT, 0&, 0&)

MsgBox N & " 行"

Follow Ups: