G
Guest
Hi Everyone.
I was using the following code in VB6, but am in the middle of converting
the app to VB.Net 2005. He is the code
Private Sub ClearAll()
On Error GoTo Error_Routine
Call appLogger("ClearAll", "FrmPatientInfo")
Dim lcol As Control
isLoading = True
For Each lcol In Me.Controls
If TypeOf lcol Is TextBox Then
lcol.Text = ""
lcol.Tag = ""
ElseIf TypeOf lcol Is Image Then
lcol.Picture = LoadPicture(DefaultImage, vbLPCustom, vbLPDefault)
lcol.Tag = ""
ElseIf TypeOf lcol Is TDBMask Then
lcol.Text = ""
lcol.Tag = ""
ElseIf TypeOf lcol Is OptionButton Then
lcol.Value = False
lcol.Tag = ""
ElseIf TypeOf lcol Is TDBCombo Then
lcol.Text = ""
lcol.Tag = ""
ElseIf TypeOf lcol Is CheckBox Then
lcol.Value = 0
lcol.Tag = ""
ElseIf TypeOf lcol Is TDBDate Then
lcol.Value = Null
lcol.Tag = ""
ElseIf TypeOf lcol Is Label Then
If lcol.BackColor = &HFFF3E8 Then
lcol.Caption = ""
lcol.Tag = ""
End If
ElseIf TypeOf lcol Is ComboBox Then
lcol.Text = ""
lcol.Listindex = -1
lcol.Tag = ""
ElseIf TypeOf lcol Is CheckBox Then
End If
Next
isLoading = False
imgPatient.Tag = ""
Exit_Routine:
Exit Sub
Error_Routine:
Debug.Assert False
Errorlog "frmPatientInfo.ClearAll"
End Sub
I'd like it to clear the controls depending on the control, as you can see
above. I'm getting errors in VB.net that a property is not a member of
Control. Oneone got some suggestions. Thanks.
Michael Lee
I was using the following code in VB6, but am in the middle of converting
the app to VB.Net 2005. He is the code
Private Sub ClearAll()
On Error GoTo Error_Routine
Call appLogger("ClearAll", "FrmPatientInfo")
Dim lcol As Control
isLoading = True
For Each lcol In Me.Controls
If TypeOf lcol Is TextBox Then
lcol.Text = ""
lcol.Tag = ""
ElseIf TypeOf lcol Is Image Then
lcol.Picture = LoadPicture(DefaultImage, vbLPCustom, vbLPDefault)
lcol.Tag = ""
ElseIf TypeOf lcol Is TDBMask Then
lcol.Text = ""
lcol.Tag = ""
ElseIf TypeOf lcol Is OptionButton Then
lcol.Value = False
lcol.Tag = ""
ElseIf TypeOf lcol Is TDBCombo Then
lcol.Text = ""
lcol.Tag = ""
ElseIf TypeOf lcol Is CheckBox Then
lcol.Value = 0
lcol.Tag = ""
ElseIf TypeOf lcol Is TDBDate Then
lcol.Value = Null
lcol.Tag = ""
ElseIf TypeOf lcol Is Label Then
If lcol.BackColor = &HFFF3E8 Then
lcol.Caption = ""
lcol.Tag = ""
End If
ElseIf TypeOf lcol Is ComboBox Then
lcol.Text = ""
lcol.Listindex = -1
lcol.Tag = ""
ElseIf TypeOf lcol Is CheckBox Then
End If
Next
isLoading = False
imgPatient.Tag = ""
Exit_Routine:
Exit Sub
Error_Routine:
Debug.Assert False
Errorlog "frmPatientInfo.ClearAll"
End Sub
I'd like it to clear the controls depending on the control, as you can see
above. I'm getting errors in VB.net that a property is not a member of
Control. Oneone got some suggestions. Thanks.
Michael Lee