.NET Framework - WordWrap lost in .net ?

Asked By Christian Hubert-Hugoud / weabow - Xtrem7 - Groobax
12-Mar-10 10:53 AM
In VB6 we have the WordWrap property, whiche enables the growth of the label
control. it is useful, because we just have to put text into it, and the
control resizes itself properly.

I need to manage the same behavior in FW4, WPF. But the label is not
multiline, and I did not find any control which grows to wrap its content.

Maybee I am missing something somewhere ? Do you have a solution ?

Christian
Visual Basic 6.0
(1)
TextBlock
(1)
TextBox
(1)
WPF
(1)
WPFyet
(1)
OP
(1)
Textbox.Christian
(1)
Groobax
(1)
  Nathan Sokalski replied to Christian Hubert-Hugoud / weabow - Xtrem7 - Groobax
12-Mar-10 11:46 AM
Being a web developer, I cannot claim to know a lot about that, but after
looking at the documentation, I found the following:

ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_vbvers/html/200d20d2-b15a-4446-87e2-b599c2506bdb.htm

Which includes the following two pieces of information:


WordWrap Property
In Visual Basic 6.0, the WordWrap property determines if text wraps to
multiple lines when it is too long to fit in a label.

In Visual Basic 2008, the text in a Label control automatically wraps. The
only way to prevent wrapping is to make the height of the Label control
equivalent to a single line of text.



WordWrap
New implementation.

Note:
Text in the Visual Basic 2008 Label control wraps by default and cannot be
changed.



What the purpose of the WordWrap property is if wrapping cannot be changed,
I do not know, but like I said, I am a web developer, so I have not used it
much. Good Luck!
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
  Peter Duniho replied to Christian Hubert-Hugoud / weabow - Xtrem7 - Groobax
12-Mar-10 12:00 PM
You can set a TextBox to Multiline and ReadOnly.  it is not quite exactly
the same as a wrapping, multiline Label but it comes close.

Alternatively, the Label control is one of the easiest to create a
custom version of, so you could just write your own.

Pete
  Jeff Johnson replied to Nathan Sokalski
12-Mar-10 12:02 PM
Your answer is unfortunately the opposite of what the OP wants. MSDN is
saying that if you have a really tall label, the text it contains will wrap
within it. The OP has a really short label and wants it to automatically
GROW when the (now missing) WordWrap property is set to True. WordWrap is
actually a bad name for the functionality. It would have been better named
the years with the way VB6 named things.)
  Patrice replied to Christian Hubert-Hugoud / weabow - Xtrem7 - Groobax
12-Mar-10 01:43 PM
Not a WPF expert but a TextBlock can wrap (interested but we do not use WPF
yet at our shop). If you do not find any other solution you could likely use
a TextBlock inside your Label...

--
Patrice

écrit dans le message de groupe de discussion :
  Christian Hubert-Hugoud / weabow - Xtrem7 - Groobax replied to Christian Hubert-Hugoud / weabow - Xtrem7 - Groobax
13-Mar-10 02:33 AM
Thanks a lot for your answers. I am goning to test the textbox.

Christian
Create New Account
help
Verfuegung stellen. ;-) Wer Newsgroups vorzieht, kann auch nach de.* "umziehen". Dort wurde nie eine spezifische Basic-Gruppe eingericht, weil sich die ganzen Teilnehmer in microsft.* getummelt haben. Daher ist die "allgemeine" Programmier-NG die Anlaufstelle (bei entsprechend laengerfristig hohem Postigaufkommen laesst sich aber eine Basic bzw. VisualBasic-NG einrichten): microsoft.public.de.vb - -> de.comp.lang.misc microsoft.public.de Jahr, dafuer ziemlich gut gepflegt) http: / / www.arcor.de / ums / ums_index.jsp (Im kostenlosen PIA basic ist auch ein Newsserver inbegriffen) http: / / albasani.net / (kostenlos) Beachten sollte man aber bei de de.* nur darauf Bedacht auch Nachbarthemen zu begutachten. So kann es gut sein, dass eine . . .basic-Gruppe bessere Chancen hat, da damit auch andere Basic-Dialekte angesprochen werden. Ingo Ingo Moch <myjunkmail.not_reading@gmx.de> schrieb im Beitrag Ich habe gro? bei einer Insell?sung f?r Insider zu landen. Thorsten D?rfler - - Microsoft MVP Visual Basic vb-hellfire visual basic faq | vb-hellfire - einfach anders http: / / vb-faq.de / | http: / / www.vb-hellfire.de
der MSDN Foren, kein dediziertes Forum f?r VB.classic. Es gibt zwar ein allgemeines Visual Basic Forum [2], in dem es offiziell keine Versionsbeschr?nkung gibt, dieses befasst sich aber schwerpunktm ich mich mit Kay Giza kurzgeschlossen und ihn gefragt, ob er bereit w?re ein Visual Basic 6.0 Forum einzurichten. Er hat diesen Gedanken positiv aufgenommen und sich bereit erkl?rt ein bereits vorhandenen Ressourcen des Visual Basic 6.0 Resource Centers [3] ein und bietet dann zuk?nftig einen direkten Nachfolger dieser
bei jedem neustart, was ist da faul ? Danke für Hinweise Karsten Schulz VC - German Discussions Visual Studio 2008 (1) Visual Studio (1) Office (1) CorrectSpellT (1) SPMicrosoft (1) Directories (1) Heritage® (1) Houghton (1) Hallo of Programming FAQ: http: / / www.mpdvc.de Samples: http: / / www.codeproject.com Hi Martin, Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1 Installed Edition: Enterprise Microsoft Visual Basic 2008 91899-270-6248762-60410 Microsoft Visual Basic 2008 Microsoft Visual C# 2008 91899-270-6248762-60410 Microsoft Visual C# 2008 Microsoft Visual C++ 2008 91899
Instalación de grid32.ocx .NET Framework Hola, Estoy instalando Visual Estudio 6.0. Mi problema es que no se instala grid32.ocx. Sé que debo hacerlo manualmente pero sé cómo ubicar ese archivo en el CD de instalación. Gracias. Renee VB - Spanish Discussions Visual Basic 6.0 (1) Visual Basic 4.0 (1) ActiveX (1) Instalación (1) Ferreira (1) Estudio (1) Víctor (1) Suerte
x64 Microsoft Windows NT 6.1.7600.0 Vista Ultimate SP2 x64 Microsoft Windows NT 6.0.6002 Service Pack 2 Windows 7 Ultimate x86 Microsoft Windows NT 6.1.7600.0 Vista Ultimate SP2 x86 Microsoft Windows NT 6.0.6002 Service Pack 2 Windows Server Enterprise 2008 SP2 Microsoft Windows NT 6.0.6002 Service Pack 2 XP Professional SP3 Microsoft Windows NT 5.1.2500 Service Pack way to do this, I guess it will have to do. Why ? The 5.1 / 6.0 / 6.1 is usually enough. You can check what is available via WMI. Small example