Solved

Printing string!

Posted on 2002-07-16
5
122 Views
Last Modified: 2010-05-02
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?
0
Comment
Question by:kuist
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Expert Comment

by:DrDelphi
ID: 7158405
Set WordWrap to True on the label. Also, you'll need to insert Chr(13) wherever you have those non-printable characters. This simulates a return. For example:

Label1.Caption = "Dave" + Chr(13) + "was" + Chr(13) + "Here"



Shows on three lines.


Good luck!!
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7158415
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.
0
 

Author Comment

by:kuist
ID: 7158429
drdelphi: well.. could I use something to replace all return by Chr(13) within the string?!
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 75 total points
ID: 7158432
sText = Replace(sText, vbCRLF, vbCR)

Anthony
0
 
LVL 3

Expert Comment

by:schworak
ID: 7158863
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.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question