Assesment of control property

Momo

Member
Joined
May 30, 2006
Messages
21
Programming Experience
Beginner
if I have a function as below:
VB.NET:
Public Sub ClearControls(ByVal ctrl As Control)
        If TypeOf ctrl Is TextBox Then
            ctrl.Text = ""
        End If
End sub

How I'm going to do in vb.net As I want .Text to be feaxible. As what I means is I want something likes I can change ".Text" to ".Enabled" based on different need by add on another parameter in the function.
Can I achieve this?
I understand that I oso can achieve this by by put in if...else in this function to achieve what I want.
But, I would like to know can I achieve by using the method I mentioned above. I'm newbie of vb.net, if I'm wrong pls point out my mistake and lead me to a more efficient approach. Thanks.
 
Back
Top