'text1的MultiLine 属性要设为true Option ExplicitConst EM_GETLINECOUNT = &HBAPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As LongPrivate Sub Command1_Click()Dim Ret As Long Ret = SendMessage(Text1.hWnd, EM_GETLINECOUNT, 0, ByVal 0&) '取行数 Debug.Print RetEnd Sub
Option ExplicitConst EM_GETLINECOUNT = &HBAPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As LongPrivate Sub Command1_Click()Dim Ret As Long
Ret = SendMessage(Text1.hWnd, EM_GETLINECOUNT, 0, ByVal 0&) '取行数
Debug.Print RetEnd Sub
我试试先~
返回值为1,另外&HBA代表?
返回值为1,另外&HBA代表?检查一下你的api声明