That is nice, but StringHeight give me same value for "I" and also for "I want create special textbox with variable height according text amount."
StringHeight give me height of one line. But textbox have (in my case) more lines. I dont know how many. So I cant multiply height with lines count.
You have to take StringWidth into account.
For example, say the height of one line 15 pixels:
If StringWidth > Textbox1.Width then
StringHeight = StringHeight +15
End If
If StringHeight > Textbox1.Height then 'scrollbar is active
By doing this you add the height of one line every time the textbox moves to a new line.
You might need to experiment with the code to make it work properly.
-EDIT-
It actually seems to work fine without using StringWidth.
The only problem is that it ignores blank lines.
You can probably fix this by writing the text to a file, then reading the file line by line and counting the lines.
I attached a small example.