Show error Unable to cast object of type ‘system.windows.forms.combobox’ to type ‘system.windows.form.DateTimePicker’ on my code…
Private Sub UncheckMyControlsdtp()
Dim dtp As DateTimePicker
Try
For Each dtp In EMPGBDATA.Controls
If dtp.CalendarMonthBackground = Color.Red Then
dtp.CalendarMonthBackground = Color.White
End If
Next
Catch e As Exception
MsgBox(e.Message)
End Try
End Sub
Friends check my code and give solution…
You should check the the controls you are enumerating from
EMPGBDATA.Controlsare of typeDateTimePicker: