Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Posted

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?

Posted
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.

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

  • Leaders
Posted

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()

[sIGPIC]e[/sIGPIC]
Posted

scrolling textbox

 

Thanks. That worked fine!

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...