Results 1 to 5 of 5

Thread: Enter And Text Box

  1. #1

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    I hope I can explain this correctly.

    I have a text box that a user can type in a message with multipul lines. Then save this message for another time to a text file. When I load the message back to the text box from the file using a string, I get visual Enters (small black rectangles) not carriage returns on the text box. How do I get the text box to go to the next line instead of showing the damn black retangles.

    I hope this makes sense.

    Thanks

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    How does you save and load the file?
    Have you set MultiLine to true for the textbox?

  3. #3

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Code:
    'Save
    If msgTitle = "" Then Exit Sub
    
    Open FilePath & FileName For Append As #1
        Print #1, "[Title]= " & msgTitle
        Print #1, "[Message]= " & outMsg
    Close #1
    
    'Open
    
    Open FilePath & FileName For Input As #1
        While Not EOF(1)
            Input #1, strTemp
            If InStr(strTemp, "[Title]=") <> 0 Then
                If Not Looking Then
                    SavedMsg(Count).strTitle = Mid(strTemp, 10, Len(strTemp))
                    Looking = True
                Else
                    Count = Count + 1
                    SavedMsg(Count).strTitle = Mid(strTemp, 10, Len(strTemp))
                End If
                ReDim Preserve SavedMsg(Count + 1)
            ElseIf Looking Then
                If InStr(strTemp, "[Message]=") <> 0 Then
                    SavedMsg(Count).strMsg = Mid(strTemp, 12, Len(strTemp))
                Else
                    If SavedMsg(Count).strMsg <> "" Then
                        SavedMsg(Count).strMsg = SavedMsg(Count).strMsg & Chr(13) & strTemp
                    End If
                End If
            End If
        Wend
    Close #1
    
    txtmsg.text = SavedMsg(1).strMsg
    Yes I do Have multi lines on. It looks fine when you type it and in the text file. So it has to be in the load or the writing to the text box

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Use Line Input # instead of Input # and change Chr(13) to vbCrLf.

    Good luck!

  5. #5

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    That worked thanks

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