欢迎光临:
非常感谢您光临枕善居。本站是一个免费的基于VB,VB.NET源代码交流的平台,为大家提供优质的专业的源代码,如果您有需要,本站可以帮助在业余时间里给您寻找代码。当然,如果您有好的代码也可以在本站发布,共享给大家。
专业VB和.NET源码、编程开发教程、图标资源、USB电脑遥控器、智能家电控制开关....更多东东请进入我的淘宝小店--->
VB及.NET新源码2011(3DVD,控件+资源)
智能多路控制(串口编程开关) 带源码!
05-05
09
获取文本行数函数
作者:枕善居主 / 查看次数: 5435 / 评论: 1
Const WM_USER = &H400
Const EM_GETLINECOUNT = WM_USER + 10
#If Win32 Then
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Integer, _
lParam As Any) As Long
#Else
Private Declare Function SendMessage Lib "user" _
(ByVal hWnd As Integer, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
lParam As Any) As Long
#End If
Function TextLineCount(txtObj As TextBox) As Long
If txtObj.MultiLine = True Then
TextLineCount = SendMessage(txtObj.hWnd, EM_GETLINECOUNT, 0, 0&)
Else
TextLineCount = 1
End If
End Function
Const EM_GETLINECOUNT = WM_USER + 10
#If Win32 Then
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Integer, _
lParam As Any) As Long
#Else
Private Declare Function SendMessage Lib "user" _
(ByVal hWnd As Integer, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
lParam As Any) As Long
#End If
Function TextLineCount(txtObj As TextBox) As Long
If txtObj.MultiLine = True Then
TextLineCount = SendMessage(txtObj.hWnd, EM_GETLINECOUNT, 0, 0&)
Else
TextLineCount = 1
End If
End Function
发表评论
您没有权限发表评论!
上一篇
下一篇
相关日志:
文章来自:
Tags:
评论: 1 |
回复
|
]