Results 1 to 4 of 4

Thread: How create produce line by line output to textbox

  1. #1
    TwistedPair Guest

    Default How create produce line by line output to textbox

    Seemed simple at the time but despite my best efforts the text box does not update until everything else is finished.

    Basically I just need it to display update the text box while the an action is being taken (trying to do a status window).

  2. #2
    Join Date
    Sep 2003
    Posts
    603
    Rep Power
    0

    Default

    look into the doevent function....
    easiparcel.com Shop online and ship to Jamaica

  3. #3
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    my assumption is u doin a win form...


    Code:
    theTextBox.Text = theTextBox.Text & Environment.NewLine & somethingElse
    theTextBox.Refresh() ' after u update the text
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  4. #4
    TwistedPair Guest

    Default

    thanks man, it worked like a charm, tried to get the same effect with the webrowser control but no such luck, logic bieng I wanted to format the text, and html markup would be easir than messing with a rich textbox, anyway here is what I have.


    Dim collectedText As String
    Dim opt As New WebBrowserRefreshOption
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    formatline("This is a test")
    formatline("really it is")
    formatline("honestly")
    formatline("are u calling me a liar!!!")

    End Sub



    Private Sub formatline(ByVal input As String)

    Thread.Sleep(500)
    collectedText += DateTime.Now & input & vbNewLine
    TextBox1.Text = collectedText
    TextBox1.Refresh()

    WebBrowser1.DocumentText += "<html><body>" & collectedText & "</body></html>"
    ' WebBrowser1.Document.Write(collectedText)
    WebBrowser1.Refresh(WebBrowserRefreshOption.Comple tely)

    End Sub
    tried a couple approaches, neither worked,interestingly together they do, but don't display until the last call is made.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •