Textbox/label which add a new line and remove the last line 
Author Message
 Textbox/label which add a new line and remove the last line

Hi, do anyone know of there is, or how to make a
textbox or label where you can specify the number of line's
and when i add a new line (on top) it will drop the last line?

It must be fast because it is for a debug vieuw with very-very much
statements (It's for trace-ing)

I would like to thank everyone who tries to help me



Sun, 02 Jan 2005 15:46:35 GMT  
 Textbox/label which add a new line and remove the last line

Quote:
>Hi, do anyone know of there is, or how to make a
>textbox or label where you can specify the number of line's
>and when i add a new line (on top) it will drop the last line?

I am not sure if I understand you.

Do you want to add new line to the very bottom of the TextBox?

--
Peter Wu
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.



Fri, 07 Jan 2005 13:57:34 GMT  
 Textbox/label which add a new line and remove the last line

Hi,

I mean an label or textbox where you can do something like this:

txTrace.addLine("something")

and then this line will appear at the top of the laber or textbox, and
the same time the lastline is dropped from the textbox or label.

First, i don't know if it is possible to access a textbox or label by
lines. I know i can add a line at the top with this:

txtTrace.text = "Something" & txtTrace.text

but this is very slow if there is very much data and it grows very hard
so everytime you copy it will be slower and slower...

But the goal is to trace something

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 07 Jan 2005 15:00:17 GMT  
 Textbox/label which add a new line and remove the last line

Quote:

>I mean an label or textbox where you can do something like this:

>txTrace.addLine("something")

>and then this line will appear at the top of the laber or textbox, and
>the same time the lastline is dropped from the textbox or label.

>First, i don't know if it is possible to access a textbox or label by
>lines. I know i can add a line at the top with this:

>txtTrace.text = "Something" & txtTrace.text

>but this is very slow if there is very much data and it grows very hard
>so everytime you copy it will be slower and slower...

>But the goal is to trace something

Why not use the ListBox instead?

--
Peter Wu
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.



Fri, 07 Jan 2005 16:11:16 GMT  
 Textbox/label which add a new line and remove the last line
Thats maybe an option.. but i don't know anything over its speed but i'm
going to try it out...

(please, forgive me my bad english)

and.. thanx for the time and tinking about my problem!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 07 Jan 2005 16:44:08 GMT  
 Textbox/label which add a new line and remove the last line

Quote:

> txtTrace.text = "Something" & txtTrace.text

> but this is very slow if there is very much data and it grows very hard
> so everytime you copy it will be slower and slower...

> But the goal is to trace something

That will make the text appear to be scrolling down.  Isn't the normal
response for the text to scroll up (Consol window for example)?

For scrolling up, you might try something like this:

    Private Sub Post(ByVal TextIn As String)
        ' Provides scrolling log effect, limits lines to MAXLINES...
        Const MAXLINES = 5
        Dim CrLf As String = Environment.NewLine

        With TextBox1
            Do While .Lines.GetUpperBound(0) >= MAXLINES
                ' Remove first line of text
                .Text = .Text.Substring(.Text.IndexOf(CrLf) + CrLf.Length)
            Loop
            .SelectionStart = .Text.Length
            .SelectedText = TextIn & CrLf
        End With
    End Sub

Usage:

  Post("This is some text")
  Post("This text is on a new line")
  ...

HTH
LFS



Fri, 07 Jan 2005 20:17:02 GMT  
 Textbox/label which add a new line and remove the last line
There isn't a control that explicitly does this but you can get the same
sort of functionality by using the following code in your textbox.keyup
event.  It basically just checks to see if a newline was entered and then
gets all but the last line in the textbox and puts it back to the textbox.

If e.KeyValue = 13 Then

    TextBox1.Text = TextBox1.Text.Substring(0,
TextBox1.Text.LastIndexOf(Microsoft.VisualBasic.ChrW(13)))

End If

Hope this helps,
Eric
Visual Basic Team
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> Hi, do anyone know of there is, or how to make a
> textbox or label where you can specify the number of line's
> and when i add a new line (on top) it will drop the last line?

> It must be fast because it is for a debug vieuw with very-very much
> statements (It's for trace-ing)

> I would like to thank everyone who tries to help me



Mon, 10 Jan 2005 04:12:32 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. scrolling a multiline textbox to the last line as new lines are added...

2. forcing multiline textbox to scroll to last line...

3. delete last line in textbox

4. suppress redraw, always show last line in textbox control

5. Keeping Textbox on last line

6. Trying to retrieve the last line from a textbox

7. Create new page if last line filled

8. Difference between TextBox and Label with Ascii Line return

9. Read a MultiLine textbox line by line?

10. Limit a multi-line textbox to 10 lines ?

11. Limitting line length of each line within multiline textbox

12. MSHFlexGrid Columns (line) & TextBox lines

 

 
Powered by phpBB® Forum Software