Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PropertyGrid
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00795451
Message ID:
00795455
Views:
11
This message has been marked as the solution to the initial question of the thread.
Hi Wilson,

The PropertyGrid is used to show the properties of a class. Your example does not have any properties. Keep in mind that the PropertyGrid only displays properties that are public. Here is an example:
Public Class MyClass

    Private theString As String

    Public Property Get Title As String
        Return theString
    End Property

    Public Property Set Title(value As String)
        theString = value
    End Property
End Class
Now, put a PropertyGrid on the form. In the form_load event, do the following:

PropertyGrid1.SelectedObject = New MyClass()

The grid should browse your class.


>Is there a way to add an instance of a class to a PropertyGrid, for example:
>
>i create this class
>
>public class myclass
>  public x as integer
>end class
>
>I create an instance of this class and add it to the propertygrid selectedobject, but it does not work.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform