![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Detect If Control Contains Property How can I detect if a control contains a property. Need to use reflection somehow? If ctl.ContainsProperty("Tag") Then ctl.Tag = "some tag information" |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Detect If Control Contains Property Derek Hart wrote: Quote: > How can I detect if a control contains a property. 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 Quote: > Need to use reflection somehow? a bit slower as well. HTH, Phill W. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Set Focus To Specific Property In Property Grid | .NET General | |||
| Value under the CPU property? | PowerShell | |||