Skip to content

Clear Method

Description

The Clear method removes all the verbs from the verb panel.

Syntax

Public Sub Clear()

Remarks

The Clear method is used to hide the verb panel and remove all of the verbs.

The verb panel is displayed when the first verb is added to the property grid's verb collection. To hide the verb panel, all verbs must be cleared from the verb collection.

Example

Hiding and Showing the Verb Panel (Visual Basic)

This sample illustrates how to hide and show the verb panel. This sample assumes that there is a check box control named chkShowVerbs.

' Verb Ids  
Const VERB_PROPERTIES = 100  
Const VERB_EDIT = 101  
Const VERB_ABOUT = 102  

Private Sub Form_Load()  
    ' Adds the verbs to the verb panel and displays the verb panel.  
    ShowVerbs  
End Sub  

Private Sub ShowVerbs()  
    ' Adds a verb to the property grid's verb collection. This will cause the verb  
    ' panel to be displayed.  
    wndPropertyGrid.Verbs.Add "ActiveX - Properties...", VERB_PROPERTIES  
    wndPropertyGrid.Verbs.Add "ActiveX - Edit", VERB_EDIT  
    wndPropertyGrid.Verbs.Add "ActiveX - About...", VERB_ABOUT  

    ' Changes the caption of the first verb.  
    wndPropertyGrid.Verbs(1).Caption = "ActiveX - Properties..."  

    ' Set the height of the verb panel to 50 pixels  
    wndPropertyGrid.VerbsHeight = 50  
End Sub  

' This subroutine is called when the chkShowVerbs check box control is  
' clicked. It will hide and show the verb panel.  
Private Sub chkShowVerbs_Click()  
    If (chkShowVerbs) Then  
        ' Adds the verbs to the verb panel and displays the verb panel.  
        ShowVerbs  
    Else  
        ' Removes all verbs from the verb panel and hides the verb panel.  
        wndPropertyGrid.Verbs.Clear  
    End If  
End Sub

See Also


See Also

Property Grid ActiveX Control v24.0


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.