RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TComponentEditor.GetVerbCount Method

Returns the number of menu strings added to the context menu by the component editor.

Pascal
function GetVerbCount: Integer; virtual;
C++
virtual __fastcall int GetVerbCount();

The form designer calls GetVerbCount when the user right-clicks the component in order to determine the number of menu items that should be added to the context menu. It then adds the menu items by calling GetVerb for every value from 0 to GetVerbCount - 1.  

TComponentEditor does not supply any verbs for its component. As a result, GetVerbCount returns 0. Override GetVerbCount when providing a set of verbs, or menu strings, to be added to the context menu. When overriding GetVerbCount, override GetVerb to return the actual strings, and override ExecuteVerb to implement a response to each of these verbs. For example, if adding two verbs to the context menu, GetVerbCount should return 2, GetVerb should return a value for an Index of 0 and for an Index of 1, and ExecuteVerb should perform the corresponding actions for an Index of 0 and for an Index of 1. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!