CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: thanks

  1. #1
    Join Date
    May 2001
    Posts
    155

    thanks

    I finally figured out how to keep an item in a listbox when the user exits. Thanks to all who helped me.
    And i didn't use a database

    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: thanks

    Just as a point of order. If you find out how do do something, share the knowledge with the rest of us that answer your questions.

    John G

  3. #3
    Join Date
    May 2001
    Posts
    155

    Re: thanks


    private Sub Command1_Click()
    Dim a
    a = InputBox("enter item")
    List1.AddItem a
    RichTextBox1.Text = a
    End Sub

    private Sub Form_Load()
    Dim FilePath as string

    FilePath = App.Path & "\test.txt"
    If len(Dir(FilePath)) = 0 then
    Dim f as Integer
    Dim fso as FileSystemObject
    f = FreeFile
    set fso = new FileSystemObject
    fso.CreateTextFile App.Path & "\test.txt", true
    Open App.Path & "\test.txt" for Output as f
    print #f, RichTextBox1.Text
    Close f
    List1.AddItem RichTextBox1.Text
    else
    RichTextBox1.filename = App.Path & "\test.txt"
    End If
    List1.AddItem RichTextBox1.Text
    End Sub

    private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)
    Dim f as Integer
    Dim fso as FileSystemObject

    f = FreeFile
    set fso = new FileSystemObject
    fso.CreateTextFile App.Path & "\test.txt", true
    Open App.Path & "\test.txt" for Output as f
    print #f, RichTextBox1.Text
    Close f
    End Sub






    --Ant
    --------------------------------------------------
    check out my newest freeware
    E-mail me at: [email protected]
    for the address

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

Featured