Message Window TextBox

sm4rtb0mb
09-04-2003, 11:54 AM
I'm trying to make a multiline text box in my program where upon completion of certain functions, a new line of text is written to the TextBox.. I Tried something like;

Function MessageWindow(TextLine as String)
txtMessages.Text = TextLine & vbCrLf 'or vbNewLine
End Function

Yes, the properties for MultiLine are True, but I am still only getting one line written in the same spot every time. Do I need to make a counter to increment the lines every time the function is called to make it write to the next line? All my searches have pulled up scrolling problems and multiple line writes to text files and I'm at a loss until I can solve this.

John
09-04-2003, 11:57 AM
Try this:
Function MessageWindow(TextLine As String)
txtMessages.Text = txtMessages.Text & TextLine & vbCrLf 'or vbNewLine
End Function

sm4rtb0mb
09-04-2003, 11:59 AM
works like a charm. Thank-You very much!

Van^
09-04-2003, 01:43 PM
works like a charm. Thank-You very much!

A better way would be to use the Sel properties. I explained this in a previous post, and even had an append text function written. While the above code works, it will cause flickering as the textbox resets itself and then enters in the new text. Look at my post here and you'll have a better understanding of how strings work and how you should append.

http://www.visualbasicforum.com/showthread.php?t=97978

--Van^

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum