Solved

turn off text wrap on a label

Posted on 2008-10-10
8
410 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
[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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

Author Comment

by:ClaudeWalker
ID: 22691341


That would definitely work.


0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

696 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