PropertyGrid in Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

This lesson describes the PropertyGrid control


PropertyGrid

This control displays information about an object in a format similar to the one used by the Properties window.

It lets you organize the properties alphabetically or by category, and also lets you edit the property values.

example

The control's two most important properties are SelectedObject and SelectedObjects, which get or set the object(s) associated with the PropertyGrid.

The PropertyGrid control displays only object properties, not public variables, and it displays only properties that are browsable.

If you give a property the Browsable(False) attribute, the PropertyGrid will not display it.

Instead you need to set the Browsable attribute to True:

    < Browsable(True) > _
    Public Property StudentName() As String
        Get
            Return _name
        End Get
        Set(value As String)
            _name = value
        End Set
    End Property

Previous Lesson | Next Lesson


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.