wsyeager Posted May 5, 2006 Posted May 5, 2006 I'm using Windows Forms 2.0 (Visual Stduio 2005) and cannot get characters within the textbox to scroll. I need displays coming out because it is a batch process and need to allow operators of the app to view the messages. I have the following code which I want to basically have show up in the window like so: line1 line 2 etc. <code> TextBox1.Text = ControlChars.CrLf & "Retrieving Search Definitions along with their respective Search Criteria." 'do some processing TextBox1.Text = ControlChars.CrLf & "Retrieved Search Definitions along with their respective Search Criteria." </code> I have the above type of code in several places in my app. Every time the textbox gets assigned a value, I perform the "Application.DoEvents()" method. It's being written to the textbox, but is not available in the view. When another message comes along, it seems like it doesn't write it underneath the previous one, although other messages are coming out. It simply writes to the very first line in the textbox again. I have the following pertinent properties set up for my textbox: AcceptsReturn = True AcceptsTab = True Enabled = True Locked = False MaxLength = 0 MultiLine = True ReadOnly = True Scrollbars = Vertical Visible = True WordWrap = True How can I get the characters in the textbox to appear underneath one another? Quote Thanks, Bill Yeager (MCP, BCIP) Microsoft Certified Professional Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer YeagerTech Consulting, Inc.
jch001 Posted May 5, 2006 Posted May 5, 2006 don't you just need a += TextBox1.Text += ControlChars.CrLf & "Retrieved Search Definitions along with their respective Search Criteria." otherwise it will just overwrite the whole text? Quote
wsyeager Posted May 5, 2006 Author Posted May 5, 2006 don't you just need a += TextBox1.Text += ControlChars.CrLf & "Retrieved Search Definitions along with their respective Search Criteria." otherwise it will just overwrite the whole text? Yes, that works fine... I should have thought about that one... Is there any way to make the textbox automatically scroll down while the lines are being written out? Since I have this form running on a thread, I can't readily move the scroll bar down to take a look at the line. It would also be a lot easier if it would just automatically scroll. Quote Thanks, Bill Yeager (MCP, BCIP) Microsoft Certified Professional Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer YeagerTech Consulting, Inc.
Leaders snarfblam Posted May 5, 2006 Leaders Posted May 5, 2006 Is there any way to make the textbox automatically scroll down while the lines are being written out? Something like this should work immediately after you update the text... TextBox1.SelectionStart = TextBox1.Text.Length TextBox1.ScrollToCaret() Quote [sIGPIC]e[/sIGPIC]
wsyeager Posted May 8, 2006 Author Posted May 8, 2006 scrolling textbox Thanks. That worked fine! Quote Thanks, Bill Yeager (MCP, BCIP) Microsoft Certified Professional Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer YeagerTech Consulting, Inc.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.