all text in texbox is visible?

B

Boni

Dear Sirs,
how is it possible to know if all text in a textbox is visible or the text
was too long and a part is invisible?
So I need to know max number of characters in visible space.
 
C

Chris

Boni said:
Dear Sirs,
how is it possible to know if all text in a textbox is visible or the text
was too long and a part is invisible?
So I need to know max number of characters in visible space.

You should be able to measure the length of the string in the OnPaint
procedure of the textbox. I think you have to add a handler to get
access to it. Then check if the lenght of the textbox is long enough to
handle the length of the string. Use the graphics.measurestring method.
You'll get the graphics object passed in which is why you should do
this in the OnPaint procedure.

Hope it helps.
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top