• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

turn off text wrap on a label

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
ClaudeWalker
Asked:
ClaudeWalker
  • 4
  • 3
1 Solution
 
mbizupCommented:
Have you tried sizing the label vertically so that it will only show one line?

This seems to work for me.
0
 
ClaudeWalkerAuthor Commented:
The problem is that I have carriage returns in the caption.  
0
 
ClaudeWalkerAuthor Commented:
It is the size of 3 lines worth of text.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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


That would definitely work.


0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Also ... do you need to get rid of carriage returns ?

mx
0
 
ClaudeWalkerAuthor Commented:
That makes sense.  

No the carriage returns need to be there.

Thanks for your help,

JOe K.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now