|
-
Sep 29th, 2000, 12:57 PM
#1
Thread Starter
New Member
I run a DOS batch file store the info it shows to a text file and then load it in a VBtextbox but,
it shows them silly BLACK SQUARES instead of goin onto a new line,
Please help HOW do I change the squares to new lines in the textbox!
-
Sep 29th, 2000, 12:59 PM
#2
Fanatic Member
Is your textbox set up for multiline?
-
Sep 29th, 2000, 01:01 PM
#3
Thread Starter
New Member
yes
yes it is there must b a simple way, notepad cant do it but wordpad can!
-
Sep 29th, 2000, 01:02 PM
#4
Fanatic Member
You need to make sure you have your text box MultiLine Property set to True.
-
Sep 29th, 2000, 01:04 PM
#5
Thread Starter
New Member
-
Sep 29th, 2000, 01:05 PM
#6
Fanatic Member
Maby your file's line returns are messed up
have you tryed making a new text file and loading that?
-
Sep 29th, 2000, 01:12 PM
#7
Fanatic Member
Then, try this:
You'll need to find out the ASCII value of the black box.
Do a replace statement on Text1.Text. In all instances, replace vbLF with chr(XXX) if the black box is not a Line Feed character. XXX = the ASCII code of the character.
Code:
Replace(Text1.Text,vbLF, vbCRLF)
If you don't have the replace function, try this:
Code:
Dim X As Long
Dim sChar As String
Dim sNewText As String
sNewText = ""
For X = 1 to Len(Text1.Text)
sChar = mid(Text1.Text, X, 1)
If sChar = vbLF then
sNewText = sNewText & vbCRLF
Else
sNewText = sNewText & sChar
End If
Next X
Text1.Text = sNewText
Hope this helps you out.
-
Sep 29th, 2000, 01:20 PM
#8
Thread Starter
New Member
no luck mate
-
Sep 29th, 2000, 03:47 PM
#9
How about
Code:
Replace(Text1.Text,vbCR, vbCRLF)
-
Sep 29th, 2000, 09:39 PM
#10
Frenzied Member
I dont have the code but you can search for that character then replace it with a "vbNewLine"
NXSupport - Your one-stop source for computer help
-
Sep 29th, 2000, 09:57 PM
#11
How about:
Code:
Replace(Text1.Text,chr(13), vbCRLF)
Replace(Text1.Text,chr(10), vbCRLF)
Replace(Text1.Text,chr(16), vbCRLF)
Replace(Text1.Text,chr(17), vbCRLF)
Replace(Text1.Text,chr(18), vbCRLF)
Replace(Text1.Text,chr(19), vbCRLF)
Replace(Text1.Text,chr(20), vbCRLF)
Note that all of these may be used.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|