module1.bas
来自「这里有很多很实用的VB编程案例,方便大家学习VB.」· BAS 代码 · 共 18 行
BAS
18 行
Attribute VB_Name = "Module1"
Option Explicit
Const EM_GETLINE = &HC4
Public 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 Function getlinetext(Text1 As TextBox, ByVal ntx As Long) As String
Dim str1(255) As Byte
Dim str2 As String, i As Long
str1(0) = 255
i = SendMessage(Text1.hwnd, EM_GETLINE, ntx, str1(0))
If i = 0 Then
getlinetext = ""
Else
str2 = StrConv(str1, vbUnicode)
getlinetext = Left(str2, InStr(1, str2, Chr(0)) - 1)
End If
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?