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

Thread: text box

  1. #1
    Join Date
    May 2001
    Location
    MO, USA
    Posts
    87

    text box

    is there a way to save the contents of a text box until the user changes it....it remains the same during startup and shut down till you put in a new amount.....

    thanx

    midnightservice


  2. #2
    Join Date
    Jul 2000
    Location
    Hawaii
    Posts
    281

    Re: text box


    Dim tFile$

    private Sub Form_Load()
    Dim f%, t$

    tFile = "c:\text1.ini"
    If Dir$(tFile) <> "" then
    f = FreeFile
    Open tFile for input as f
    Line input #f, t
    Text1.Text = t
    Close f
    End If
    End Sub

    private Sub Form_Unload(Cancel as Integer)
    Dim f%

    f = FreeFile
    Open tFile for Output as f
    print #f, Text1.Text
    Close f
    End Sub





  3. #3
    Join Date
    Sep 2001
    Location
    Oregon, USA
    Posts
    12

    Re: text box

    hi i was just wondering if you knew of a way to do that same thing, but with 3 textbox, 2 listbox, and a chkbox all on same form? thats exactly the kind of thing i need if you can help. thanks,

    -frank


  4. #4
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: text box

    You can also link listboxes and checkboxes to a datacontrol. For listboxes, you will need to fill the list yourself, but it should automatically select the correct item, and save it.


    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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