Hide ScrollBar of TextBox

P

Palm Kevin

Hi,
I need absolutely your help.

I need to have a multiline-textbox that shows the scrollbars ONLY when
there is too much text to be displayed in the box. (Only vertical);


When doing so :
textbox.ScrollBars = ScrollBars.Vertical
then the scrollbars is ALWAYS visible, even if the scrollbar is not
usefull...

A possiblity could be to measure the text heigth of the textbox-content
with the Graphics.measureMeasureString(string,Font).
But the problem is that the Textbox breaks a string when it is too long
for its container. Therefore it is not possible to measure the
text-height of the string (actually it depends on the textbox-width...)

Thanks beforehand,
Kevin
 
M

MichaelLipp[MS]

Sorry, the behavior of showing a disabled vertical scrollbar is the way the
native edit control works. I can't think of a way to outsmart it, or to
tell when the scrollbars become enabled.



NETCF Beta FAQ's -- http://www.gotdotnet.com/team/netcf/FAQ.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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