Finding the Property's return type

T

Tom

Hey,

I'm trying to set every property in an inherited control to Browsable
false, so i can create some custom ones for what i need. I am generating
these automatically so i can copy+paste, but i am having trouble getting
the return type (To put in the property definition).

Dim spo As String = ""
For Each s As Reflection.PropertyInfo In MyBase.GetType().GetProperties
If s.CanRead Then
spo &= "<Browsable(False)> _" & vbCrLf & "Public Overrides "
If True <> s.CanWrite Then
spo &= "ReadOnly "
End If
spo &= "Property "
spo &= s.Name & "() As " & s.GetType.GetType().Assembly.FullName
spo &= vbCrLf & "Get" & vbCrLf & vbCrLf & "End Get" & vbCrLf
If s.CanWrite Then
spo &= "Set(Byval value)" & vbCrLf & vbCrLf & "End Set" & vbCrLf
End If
spo &= "End Property" & vbCrLf & vbCrLf
End If
Next


s.GetType.GetType().Assembly.FullName is where i would like the string
of the return type of that property but icannot figure out how to get
the return type...


Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top