Results 1 to 5 of 5

Thread: LogWindow Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    12

    Exclamation

    Hello All,

    I have an application for which I need to keep a 'running log window' with the application. I should be able to append text to the log window as some processes are completed etc. and finally have an option to save the results of the logwindow to a text file.

    The log window need not be attached to the parent window i.e. it also can be floating..

    Currently I have the VB Debug.Print to spit out messages but, in my compiled application i would like them to appear in a text box. i tried RichText Control, But I could not find a way to add text regularly.

    Can some one kindly point me to a control or a sample code or a method with which i can do it. ?

    thanks a lot

    Regards
    Sathya
    Sathya Krishnamurthy
    Research Scientist , CSCS
    Switzerland

  2. #2
    Junior Member
    Join Date
    Sep 2000
    Location
    Poland
    Posts
    26
    hi,
    I'm sure you have tried something like that:
    Code:
    MyTextBox.text = MyTextBox.text & "abc"
    ?

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    12

    Hi Syl

    From MSDN
    <quote>
    The Text setting for a TextBox control is limited to 2048 characters unless the MultiLine property is True, in which case the limit is about 32K.
    </quote>

    So for a running text it is difficult to use it.

    Thanks for your response.

    Ciao
    Sathya
    Sathya Krishnamurthy
    Research Scientist , CSCS
    Switzerland

  4. #4
    Guest
    Have you tried a listbox?

    Code:
    list1.additem "This is a line of text"
    I always use it for logging. I do keep an eye on the list item's count, so if it goes over say 1000 items, i clear the first 500 and save them to a file. Then I erase the first 500 items from the listview...

    Hope I could help... Tell me if you need more info...

  5. #5
    Guest
    Hi...

    Wrote & tested some code:

    Code:
        Dim T As Integer
        
        ' Fill listbox with 2000 items...
        For T = 1 To 2000
            List1.AddItem "Blah" & T
        Next T
    
        ' Remove first 1000...
        While List1.ListCount > 1000
            ' Save Item(0) here to your logfile
            List1.RemoveItem 0
        Wend
    Enjoy....

Posting Permissions

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



Click Here to Expand Forum to Full Width