I have a groupbox with a number of textboxes. I want to loop through all the textboxes, get their value( text) and add them all together and show it in a final totaltextbox outside the groupbox. This is what i have done but it does not work. The totaltextbox values do not change. Here is my code :
any suggestions. Thanks for the help so far.
VB.NET:
Private Sub AGroupBox_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles AGroupBox.VisibleChanged
Dim xxx As Integer
Dim tota, ax As Integer
Dim min As Integer = 6
If Me.AGroupBox.Visible = True Then
For Each _control As Control In Me.AGroupBox.Controls
If TypeOf (_control) Is TextBox Then
ax = CInt(_control.Text)
xxx = CInt(totalTextBox.Text)
tota = CInt(ax + xxx)
End If
totalTextBox.Text = CStr(tota)
Next
End If
End Sub
any suggestions. Thanks for the help so far.