I have always made a "setdefault" function and for everything that can change I have the default setting in this function. You can also do some short cuts like:
Public Sub EmptyTextBoxes(ByRef frm As System.Windows.Forms.Form)
Try
Dim ctrl As System.Windows.Forms.Control
For Each ctrl In frm.Controls
If TypeOf ctrl Is System.Windows.Forms.TextBox Then
ctrl.Text = ""
End If
If TypeOf ctrl Is System.Windows.Forms.Label Then
'Labels with prefix lblCap are not to be changed.
If Mid(ctrl.Name, 1, 6) <> "lblCap" Then
ctrl.Text = ""
End If
End If
Next
Catch ex As Exception
ErrMsg(ex)
End Try
End Sub
Public Sub EmptyListView(ByRef lv As System.Windows.Forms.ListView)
Try
Do While lv.Items.Count > 0
lv.Items.RemoveAt(0)
Loop
Catch ex As Exception
ErrMsg(ex)
End Try
End Sub
I hope this helps. You could also close the form and reopen it.
Kris
![[pc3] [pc3] [pc3]](/data/assets/smilies/pc3.gif)