|
|
|
Click here to copy the following block | 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 Const EM_FMTLINES = &HC8
Function TextBoxGetLines(tb As TextBox, Optional KeepHardLineBreaks As Boolean) _ As String() Dim result() As String Dim i As Long
SendMessage tb.hwnd, EM_FMTLINES, True, ByVal 0&
result() = Split(tb.Text, vbCrLf)
For i = 0 To UBound(result) If Right$(result(i), 1) = vbCr Then result(i) = Left$(result(i), Len(result(i)) - 1) ElseIf KeepHardLineBreaks Then result(i) = result(i) & vbCrLf End If Next
SendMessage tb.hwnd, EM_FMTLINES, False, ByVal 0&
TextBoxGetLines = result() End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|