?
Solved

Printing string!

Posted on 2002-07-16
5
Medium Priority
?
123 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 300 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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