Excel VBA高级编程:用API函数获取TextBox行数

2015-04-13 16:58 阅读 234 次 评论关闭

*API函数声明
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const EM_GETLINECOUNT = &HBA
注释:在程序中调用
LineCnt = SendMessage(ctl.hwnd, EM_GETLINECOUNT, 0, 0)
注释:LineCnt即为此TextBox行数

版权声明:本文著作权归原作者所有,欢迎分享本文,谢谢支持!
转载请注明:Excel VBA高级编程:用API函数获取TextBox行数 | 猎微网

评论已关闭!