Derek said:
How can I detect if a control contains a property.
Why do you need to?
You can /ask/ any Control (or, indeed, any Object) what Type it is, and
then process it accordingly, as in
Sub Click( sender as Object e as EventArgs )
If Typeof sender is CheckBox Then
With DirectCast( sender, CheckBox )
.Text = .Text.ToUpper()
.CheckState = CheckedState.Checked
End With
Else If Typeof sender is TextBox Then
With DirectCast( sender, TextBox )
.Text = .Text.ToLower()
End With
End If
End Sub
Need to use reflection somehow?
If you /really/ must, but it's more difficult and (I would expect) quite
a bit slower as well.
HTH,
Phill W.