[求助]如何返回VB6中TextBox中某一行的字符?
<P>Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long<BR></P><P>Function GetLineText(CTextBox As TextBox, LineIndex As Long) As String <BR> Dim lc&, linechar& <BR> linechar = SendMessageBynum(CTextBox.hwnd, EM_LINEINDEX, LineIndex, 0) <BR> lc = SendMessageBynum(CTextBox.hwnd, EM_LINELENGTH, linechar, 0) + 1 <BR> GetLineText = String$(lc + 2, 0) <BR> Mid$(GetLineText, 1, 1) = Chr(lc And &HFF) <BR> Mid$(GetLineText, 2, 1) = Chr(lc \ &H100) <BR> lc = SendMessageBystring(CTextBox.hwnd, EM_GETLINE, LineIndex, GetLineText) <BR> GetLineText = left(GetLineText, lc) <BR>End Function</P>
<P>如上函数,如何声明SendMessageBynum和SendMessageBystring???</P>
<P>谢!</P>
页:
[1]