Home All Groups Group Topic Archive Search About

Textbox's text cut short

Author
25 May 2006 10:04 PM
creator_bob
How do I detect if a text box had its text cut short?  When I
dynamically create text boxes, any with incomplete text I would like to
add its text to a tool-tip.

Author
25 May 2006 10:13 PM
Herfried K. Wagner [MVP]
"creator_bob" <robertbrich***@hotmail.com> schrieb:
> How do I detect if a text box had its text cut short?  When I
> dynamically create text boxes, any with incomplete text I would like to
> add its text to a tool-tip.

You could use 'Graphics.MeasureString' to measure the text shown in the
control.  However, note that this won't lead to accurate results because
'Graphics' uses GDI+ and the textbox control is drawn by Windows using GDI.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>