This is my code to lock controls in VB6
Private Function lockControls()
For Each ctrl In Me.Controls
If TypeOf ctrl Is TextBox _
Or TypeOf ctrl Is ComboBox _
Or TypeOf ctrl Is NumBox _
Or TypeOf ctrl Is OptionButton _
Or TypeOf ctrl Is DTPicker Then
ctrl.Enabled = True
End If
Next
End Function
But when I try to run the program it is showing type mismatch and is not giving any hint.
Can anyone say what is wrong in this code.