Click here to Skip to main content
15,912,329 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralDoubt regarding Grid in .NET Pin
shankara_raman25-Mar-03 1:34
shankara_raman25-Mar-03 1:34 
GeneralValidating a xml file Pin
chito24-Mar-03 20:48
chito24-Mar-03 20:48 
GeneralRe: Validating a xml file Pin
Stephane Rodriguez.25-Mar-03 3:15
Stephane Rodriguez.25-Mar-03 3:15 
GeneralRe: Validating a xml file Pin
Paul Watson1-Apr-03 18:17
sitebuilderPaul Watson1-Apr-03 18:17 
GeneralTextBox on Desktop Icons Pin
BennyMac24-Mar-03 11:46
BennyMac24-Mar-03 11:46 
GeneralRe: TextBox on Desktop Icons Pin
Poolbeer24-Mar-03 12:15
Poolbeer24-Mar-03 12:15 
GeneralRe: TextBox on Desktop Icons Pin
BennyMac24-Mar-03 12:32
BennyMac24-Mar-03 12:32 
GeneralRe: TextBox on Desktop Icons Pin
Poolbeer25-Mar-03 6:08
Poolbeer25-Mar-03 6:08 
Hi,

If you use the StringFormat Class and pass that along with the other stuff into MeasureString you'll get the size of the text back.

Then if you do the DrawString using the same StringFormat properties the text will be drawn exactly like you want it. (ie wrapping)

Using the wordwrap property of the textbox you can get the same look as the Graphics.DrawString method using the Formatting.

Just play a little with those classes and you'll see it'll work.

the rectangle you pass into the MeasureString method should be the size of the textbox minus the border width (usually 2 px).

Good Luck.

Poolbeer


Speak Out! Use the Source, Luke!
(Dr. GUI .NET #5)
GeneralRe: TextBox on Desktop Icons Pin
BennyMac25-Mar-03 11:48
BennyMac25-Mar-03 11:48 
GeneralRe: TextBox on Desktop Icons Pin
BennyMac26-Mar-03 11:33
BennyMac26-Mar-03 11:33 
GeneralRe: TextBox on Desktop Icons Pin
Oleksandr Kucherenko28-Mar-03 4:26
Oleksandr Kucherenko28-Mar-03 4:26 
General.Net Compact Framework and JPG Pin
Braulio Dez24-Mar-03 3:20
Braulio Dez24-Mar-03 3:20 
GeneralRegistering a Pluggable Protocol (New) for IE Pin
Vasudevan Deepak Kumar23-Mar-03 18:55
Vasudevan Deepak Kumar23-Mar-03 18:55 
GeneralRe: Registering a Pluggable Protocol (New) for IE Pin
Stephane Rodriguez.24-Mar-03 8:38
Stephane Rodriguez.24-Mar-03 8:38 
GeneralWindows Installer Pin
Sergiu21-Mar-03 4:11
Sergiu21-Mar-03 4:11 
Generalproblem in dateTimePicker.ShowUpDown Pin
Member 28818920-Mar-03 22:06
Member 28818920-Mar-03 22:06 
GeneralRe: problem in dateTimePicker.ShowUpDown Pin
Vasudevan Deepak Kumar23-Mar-03 18:59
Vasudevan Deepak Kumar23-Mar-03 18:59 
GeneralSplitter windows Pin
Anonymous18-Mar-03 1:54
Anonymous18-Mar-03 1:54 
GeneralRe: Splitter windows Pin
leppie18-Mar-03 23:17
leppie18-Mar-03 23:17 
GeneralRe: Splitter windows Pin
d_mon19-Mar-03 7:32
d_mon19-Mar-03 7:32 
GeneralRe: Splitter windows Pin
leppie19-Mar-03 9:30
leppie19-Mar-03 9:30 
GeneralRe: Splitter windows Pin
d_mon19-Mar-03 9:39
d_mon19-Mar-03 9:39 
GeneralModifying the WSDL of an ASP.NET web service Pin
daragh18-Mar-03 1:17
daragh18-Mar-03 1:17 
QuestionWin Form Icon property bug? Pin
Anonymous17-Mar-03 2:25
Anonymous17-Mar-03 2:25 
AnswerRe: Win Form Icon property bug? Pin
leppie17-Mar-03 6:18
leppie17-Mar-03 6:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.