It's set to 32K for a for multiple-line regular textbox and 64K for RichTextBox (I think) which is a very large number ... What are you trying to load into the textbox?
Last edited by RhinoBull; Aug 3rd, 2005 at 08:39 AM.
It's set to 64K which is a very large number ... What are you trying to load into the textbox?
I am just making an app that is writing status of actions the app is performing. Kind of like a running log that the user could scroll through.... the thing is this app will be running 24/7 and doing something different every 20-30 seconds.
You don't write logs to a textbox but textfile or database and let user load file for a specific day or records from database (or something like that).
You don't write logs to a textbox but textfile or database and let user load file for a specific day or records from database (or something like that).
is there a way to directly link a text file into an app and keep adding to it?
Textbox is 32K limit..
The I found this about RichText
"However, the RichTextBox control doesn't have the same 64K character capacity limit of the conventional TextBox control."
doesnt have the same limit of 64K like a textbox?? but..its...um.. 32K? lol..nice
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
is there a way to directly link a text file into an app and keep adding to it?
I don't how you do it in the first place but you can simply use Open ... For Append logic to add to existing file but also you may want to create new file every day:
VB Code:
Open App.Path & "\Log\CurrendDayLogFile.log" For Append As #1
Textbox is 32K limit..
The I found this about RichText
"However, the RichTextBox control doesn't have the same 64K character capacity limit of the conventional TextBox control."
doesnt have the same limit of 64K like a textbox?? but..its...um.. 32K? lol..nice
That's what I thought it was - the 64K but then I saw in the MSDN the darn 32K so I modified my first reply ...
Just can't believe it - the right hand doesn't know what left is doing ...
I don't how you do it in the first place but you can simply use Open ... For Append logic to add to existing file but also you may want to create new file every day:
VB Code:
Open App.Path & "\Log\CurrendDayLogFile.log" For Append As #1
Print #1, "some new log"
Close #1
yeah writing to a file is no problem... is there a way I could maybe insert an instance of the word.exe inside my app and keep writing to it maybe? so it is visible to the user?
An instance of MS Word? No, that's too much for creating and displaying logs, though. Use RichTextBox but that's not how you create log - you write to a file in the background - when user wants to see it he/she will manually open it.
You could write every line to a file as it comes in and at the same time you could use SendMessage you could count the number of lines that were displayed and when the number of lines reached 1000 (5000?, 10,000?) you could begin the delete the old lines from the display as the new ones come in and in that way always have a "Last 1000" display.
log files are usually for Debug / checking if errors.. if the user needs to see it they can either open it.. oy maybe in a menu you can have an option to view the log file, in which case you could shell notepad to open it
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Yeah I could probably just limit the actual display of the text box. Is there a way I could count how many line breaks are in the box and remove any old entries after say 100 line breaks?
I will be writing to a log file also but I would like to display the most recent data going into it.
' replace all the text with the line 2 to the end text
.Text = strBuffer
End With
End If
Tried this and switched the line max lines to 10, was fine for the first 9 entries then the tenth entry would be blank. It would then allow me to keep adding more entries without remove any, just every tenth entry was a blank line.
What I would do to limit the text shown on screen would be Write all data to log file and put data line into a circular array (queue). in this way you always know the start and end of your data to copy to the textbox.
If you had an array of 100 entries, you would start at 1 and put a line in each entry until you get to the 100th entry then start at 1 again. You will always have the last 100 lines written to the log file and can output them to the textbox anytime you like.
This works kinda... It is just going backwards. The newest entry is going to the bottom of the list and the ones being erased are on the top.
That's what I think most people would expect in that it would look like it's scrolling off the screen. However you should be able to take the code and reverse it. If you need help doing that please let me know.
Did that resolve your problem? BTW Bruce Fox pointed out to me that the SendMessageStr API in my original example isn't being used so you can delete it.