kuist
asked on
Printing string!
Hi!
I'm showing a multiple line textbox so the user can enter a note, I store it into a DB and want to show it back in a label...
but everywhere where the user pressed 'enter' button, it show a little black rectangle and doesn't change line :(
Also, if the sentence is longer than the label's width, It won't automatically change line..
what solution do you suggest for me to go around that?
I'm showing a multiple line textbox so the user can enter a note, I store it into a DB and want to show it back in a label...
but everywhere where the user pressed 'enter' button, it show a little black rectangle and doesn't change line :(
Also, if the sentence is longer than the label's width, It won't automatically change line..
what solution do you suggest for me to go around that?
Those non-printable characters are probably from your CR/LF line breaks. The problem seems to be that the DB is stripping the CR/LFs and possibly converting them into either CRs or LFs.
DrDelphi's probably on track with that, if you can figure out what it converts to, but maybe another way is to put the info back into a different textbox (also with multiline on and maybe borders off to make it look like a label) then set the Locked property so users can't modify the data.
DrDelphi's probably on track with that, if you can figure out what it converts to, but maybe another way is to put the info back into a different textbox (also with multiline on and maybe borders off to make it look like a label) then set the Locked property so users can't modify the data.
ASKER
drdelphi: well.. could I use something to replace all return by Chr(13) within the string?!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Acperkins is correct but a more efficient method would be...
sText = Replace(sText,vbLF,"")
This way only the unwanted characters are removed instead of removing both the CR and LF then putting the CR back in.
sText = Replace(sText,vbLF,"")
This way only the unwanted characters are removed instead of removing both the CR and LF then putting the CR back in.
Label1.Caption = "Dave" + Chr(13) + "was" + Chr(13) + "Here"
Shows on three lines.
Good luck!!