Enumerate Control Properties in .Net
-
How can I enumerate a control's properties in .Net? I bascially want to do this (vb6 code): *****Start Code***** ctl = control strPropName = "value" For each prop in ctl.properties If propr.name = strPropName msgbox prop.value Exit For End if Next prop *****Start End***** I'm struggling with this, as it was obvious in VB6! Thanks
-
How can I enumerate a control's properties in .Net? I bascially want to do this (vb6 code): *****Start Code***** ctl = control strPropName = "value" For each prop in ctl.properties If propr.name = strPropName msgbox prop.value Exit For End if Next prop *****Start End***** I'm struggling with this, as it was obvious in VB6! Thanks
Use Control.GetType to get the Type of the control, and Type.GetProperties to get an array containing the properties of the control.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi