我是 Visual Basic 的新手。我有一个像这样的小程序。 https://www.dropbox.com/s/xr44pxp3n79atkk/wall.png
它将通过将所有墙壁面积相加来计算总面积。
Public Sub btnWallAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWallAdd.Click
FlowLayoutPanel1.Controls.Clear()
FlowLayoutPanel1.AutoScroll = True
For i As Integer = 1 To Val(txtWallNo.Text)
Dim Width As New TextBox()
Dim Height As New TextBox()
Width.Name = "Width" & i
Width.Text = Width.Name
Height.Name = "Height" & i
Height.Text = Height.Name
FlowLayoutPanel1.Controls.Add(Width)
FlowLayoutPanel1.Controls.Add(Height)
Next
End Sub
我已经根据用户输入的数字成功创建了动态文本框,但我不知道如何从这些文本框中获取值并将它们相加。请教我怎么做。非常感谢你!对不起我的英语不好!