Re: VB6 - Label - force single-line display?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jan Hyde (StellaDrinker_at_REMOVE.ME.uboot.com)
Date: 02/26/04


Date: Thu, 26 Feb 2004 12:46:49 +0000


"Robert" <noone@nowhere.com>'s wild thoughts were released
on Thu, 26 Feb 2004 12:28:03 +0100 bearing the following
fruit:

>Hello,
>
>does anyone know how to force a label to display its contents single-line
>(even when this means cutting of text at the end?
>My label is just high enough for 1 text line, WordWrap is false, and still
>the second word would wrap to the (invisible) second line if it's too long!
>

You could set AutoSize = True, WordWrap = false and then
manually set the width

Label1.Caption = "This is a long piece of text in a label
control"
Label1.Width = 400

or you could put the label in a container and let the label
autosize.

-- 
Jan Hyde (MVP - Visual Basic)
The average guy thinks about sex once every six tits 
[Abolish the TV Licence - http://www.tvlicensing.biz/]


Relevant Pages

  • VB6 - Label - force single-line display?
    ... does anyone know how to force a label to display its contents single-line ... (even when this means cutting of text at the end? ... My label is just high enough for 1 text line, WordWrap is false, and still ... the second word would wrap to the second line if it's too long! ...
    (microsoft.public.vb.general.discussion)
  • Re: Axis labels truncated in Excel 2004 Mac
    ... I also have the same problem if the label has more than one word and ... the category axis is vertical - the second word simply gets cut off. ... Has nobody else encountered those issues? ...
    (microsoft.public.mac.office.excel)
  • Re: VB6 Label WordWrap Blues
    ... My experience is that WordWrap occurs even with WordWrap set to false. ... By default, adding a Label will ... insert a new label with WordWrap and AutoSize OFF, but any text I enter is ...
    (microsoft.public.vb.controls)