Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
For each box as TextBox in me.Controls
box.property = someValue
En For
Dim box As TextBox
For Each box In Me.Controls
box.Width = 400
Next
For Each c as Control in Me.controls
If TypeOf c Is TextBox Then
c.width = 400
End If
Next
'This requires :
' Four TextBoxes called tb1, tb2, tb3 and tb4
' MultiLine set to true
' WordWrap set to True
Private LongString As String = _
"This is a string that is longer than the width of the textboxes. It will therefore " + _
"wrap onto more than one line. Additionally this string will be repeated based on the TextBox name."
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
tb1.Text = LongString
tb2.Text = LongString + " " + LongString
tb3.Text = tb2.Text + " " + LongString
tb4.Text = tb2.Text + " " + tb2.Text
For Each c As Control In Me.Controls
If TypeOf c Is TextBox Then
With CType(c, TextBox)
Dim g As Graphics = CreateGraphics()
Dim sz As SizeF = g.MeasureString(.Text, .Font, .ClientSize.Width)
.Height = CType(sz.Height, Integer)
End With
End If
Next
End Sub