VJ,
Just something made quick and dirty, althoug tested. I did not understand if
you did mean a richtextbox as in the subject or a textbox as in your
message.
This goes only about the width however it shows as a sample nice.
Maybe you can use it as a start?
Cor
\\\\
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Width = 60
End Sub
Private Sub textbox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
If TextBox1.Text <> "" Then
Dim CharWidth As Integer = _
CInt(Graphics.FromHwnd(TextBox1.Handle).MeasureStr ing(TextBox1.Text,
_
TextBox1.Font).Width / CLng(TextBox1.Text.Length))
If TextBox1.Text.Length * CharWidth > 60 Then
TextBox1.Width = CharWidth * TextBox1.Text.Length
Else
Me.TextBox1.Width = 60
End If
End If
End Sub
"VJ"
How can you automatically increase size of (Height and Width) of a TextBox
when the user types in the box (as in powerpoint for example). .
VJ