首页 相关文章 取得TextBox 某一行的字串

取得TextBox 某一行的字串

  这是使用EM_GETLINE message来做,比较奇特的是lParam是指向一个字串所在的位置,但是该字串传入时,前两个Byte要存该字串允许的最大长度。

  

'以下在Form需一个TextBox,并设定MultiLine = True, 一个Command ButtonPrivate Sub Command1_Click()Dim str5 As Stringstr5 = GetaLine(Text1,1) '取得第二行的字串,以0为基底End Sub'以下在.BasOption ExplicitConst EM_GETLINE = &HC4Declare Function SendMessage Lib "user32" Alias "SendMessageA" _    (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _     lParam As Any) As LongPublic Function GetaLine(Text1 As TextBox, ByVal ntx As Long) As Str...[ 查看全文 ]

2016-02-19 标签:

取得TextBox 某一行的字串的相关文章

手机页面
收藏网站 回到头部