| Get past the 64K limit imposed on the contents of a textbox with the SendMessage API. Note that this will work only in NT and Win2K. Private Const WM_SETTEXT = &HC Private Const WM_GETTEXT = &HD Private Const WM_GETTEXTLENGTH = &HE 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 Private Declare Function GetWindowTextLength Lib "user32" _ Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Add a multi line textbox to your form. In form_load call this code: Dim lret As Long Dim s As String s = String(9000, "X") Me.Show lRet = SendMessage(txtlarge.hwnd, WM_SETTEXT, 0&, ByVal s) Debug.Print "WM_SETTEXT: " & lRet lRet = SendMessage(txtlarge.hwnd, WM_GETTEXTLENGTH, 0&, ByVal 0&) Debug.Print "WM_GETTEXTLENGTH: " & lRet In form_resize call this code: txtlarge.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight |
Load Textbox With More Than 64K of Data |
Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design