Solved

turn off text wrap on a label

Posted on 2008-10-10
8
404 Views
Last Modified: 2013-11-28
I have a label where the caption is populated when the form is opened.  Is it possible to turn off of the text wrap on the label?

example:

If the label was the width of 8 letters and I was going to put the caption as "Hello World"

Only "Hello Wo" would be displayed.
0
Comment
Question by:ClaudeWalker
  • 4
  • 3
8 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 22690963
Have you tried sizing the label vertically so that it will only show one line?

This seems to work for me.
0
 

Author Comment

by:ClaudeWalker
ID: 22691129
The problem is that I have carriage returns in the caption.  
0
 

Author Comment

by:ClaudeWalker
ID: 22691131
It is the size of 3 lines worth of text.
0
 
LVL 75
ID: 22691329
"If the label was the width of 8 letters"

Of course, that is determined by the Font being used.

"The problem is that I have carriage returns in the caption.  "

Is that good or bad?  

So, you are saying that you would want "Hello World" to appear as "Hello Wo" ?

Not quite sure what you need ?

You could limit the length of the caption in code - would that work?

mx
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:ClaudeWalker
ID: 22691341


That would definitely work.


0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 22691369
Here is the general idea - don't know what you have for code so far ?

PRivate Sub Form_Open(Cancel As Integer)

 '  some code

Dim sMyCaption
sMyCaption = "Hello World"

If Len(myCaption)> 8 Then myCaption = Left(myCaption,8)   ' This is the main thing here

' More code

End Sub

mx
0
 
LVL 75
ID: 22691372
Also ... do you need to get rid of carriage returns ?

mx
0
 

Author Comment

by:ClaudeWalker
ID: 22691501
That makes sense.  

No the carriage returns need to be there.

Thanks for your help,

JOe K.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now