Results 1 to 2 of 2

Thread: Label/Textboxs to Notepad or other text documents??

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2003
    Posts
    55

    Label/Textboxs to Notepad or other text documents??

    Is this possible that a labelbox called lblnam and lblmem and textbox called txt5 can be transfered to notepad ( external text document)

    cheers

  2. #2
    Junior Member
    Join Date
    Dec 2003
    Location
    California
    Posts
    19
    If you are talking about transferring the control objects, no. Notepad is just a text editor.
    If you are talking about transfering the values of those objects, then yes.

    You can define variables for their values and use the streamwriter class to export them to a file of your choice, by either appending the information or creating a new document.

    An example:



    Code:
    Dim fs as System.IO.FileStream = New System.IO.FileStream("C:\myfile.txt",IO.FileMode.Create)
    Dim sw as System.IO.StreamWriter = new System.IO.StreamWriter(fs)
    
        sw.WriteLine(me.lblnam.Text)
        sw.WriteLine(me.lblmem.Text)
        sw.WriteLine(me.txt5.Text)
        sw.Flush()
        sw.Close()
        sw = nothing
        fs.Close()
        fs = nothing

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