benst
benst

Reputation: 553

Textbox.Text returns old value instead of new

I have following function in my program. The line with the ** is where it goes wrong. The value of Textbox.Text returns the old value instead of the new one. The .Text property of the textboxes get set with a different function. Then the user can change them and run this function. But the Textbox.Text field still has the old value and isn't updated. Anyone know how I can fix this?

Thanks.

Private Function saveListFromEditor()
    Dim newpartialfunctionlist As New List(Of Te)
    For Each Tab As TabPage In TabControl1.TabPages
        For Each TObj In Tab.Controls
            If TObj.GetType.ToString.ToLower = "system.windows.forms.flowlayoutpanel" Then
                Dim flowlayout As FlowLayoutPanel = CType(TObj, FlowLayoutPanel)

                Dim values As NameValueCollection = New NameValueCollection
                For Each obj In flowlayout.Controls
                    If (obj.GetType.ToString.ToLower = "system.windows.forms.textbox") Then
                        Dim textbox As TextBox = CType(obj, TextBox)
                        If (textbox.Name.ToString.ToLower = "display") Then
                            newfunction.display = textbox.Text
                        Else
                            **values.Add(textbox.Name, textbox.Text)**
                        End If
                    End If
                Next
            End If
        Next
    Next
    Return values
End Function

Upvotes: 0

Views: 459

Answers (1)

benst
benst

Reputation: 553

Problem has been solved. Issues was not part of this piece of code. Thanks for the comments and help anyway. Topic can be closed.

Upvotes: 1

Related Questions