Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox limitation

Status
Not open for further replies.

tfstom

Programmer
Sep 28, 2002
190
US
I have 64299 characters in my text box and I need to add more, but it won't take anymore.

I am displaying lines of data from my database and need about 300 more bytes.

Is that the limit VB6 will take?

Is there a way around this?

Thanks,

Tom
 
Use a RichTextBox

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
You could do this:

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 Const WM_SETTEXT = &HC

Private Sub Form_Load()
Dim s As String
s = String(70000, "@")
SendMessage text1.hwnd, WM_SETTEXT, 0&, ByVal s
End Sub


"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
Unfortunately, richtextbox is too expensive.

What exactly is the sendmessage code doing?

Do I still use a textbox control, or am I using something else?

Tom.
 
Start a new project add a textbox, change the multiline property to true add a verticle scroll bar. Then add the code above.It will populate the textbox box with 70000 '@' as an example. To use do something like

Dim strSomeValue As String
strSomeValue = Your65000PlusCharacters
SendMessage text1.hwnd, WM_SETTEXT, 0&, ByVal strSomeValue



"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
Oh yeah, meant to asked the same :)

"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
It costs about $200 (for the cheaper version).
 
My mistake.

I thought that you were talking about a richtext control I found on the Web. I didn't know there was a richtext component in VB.

I tried it and do like it. It seems to do what I need.

Thanks,

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top