Hide Table of Contents
AddCommandItem Method (IFlyoutGroup)

Adds an item to a flyout menu.

.NET Syntax

Visual Basic (Declaration) 
Function AddCommandItem( _
   ByVal Name As System.String, _
   ByVal HintString As System.String, _
   ByVal ImageListIndex As System.Integer, _
   ByVal CallbackFunction As System.String, _
   ByVal UpdateCallbackFunction As System.String _
) As System.Integer
Visual Basic (Usage) 
Dim instance As IFlyoutGroup
Dim Name As System.String
Dim HintString As System.String
Dim ImageListIndex As System.Integer
Dim CallbackFunction As System.String
Dim UpdateCallbackFunction As System.String
Dim value As System.Integer
 
value = instance.AddCommandItem(Name, HintString, ImageListIndex, CallbackFunction, UpdateCallbackFunction)
C# 
System.int AddCommandItem( 
   System.string Name,
   System.string HintString,
   System.int ImageListIndex,
   System.string CallbackFunction,
   System.string UpdateCallbackFunction
)
C++/CLI 
System.int AddCommandItem( 
&   System.String^ Name,
&   System.String^ HintString,
&   System.int ImageListIndex,
&   System.String^ CallbackFunction,
&   System.String^ UpdateCallbackFunction
) 

Parameters

Name
Name of the item to add to the flyout
HintString
Text displayed in the SOLIDWORKS status bar when the pointer is on the item
ImageListIndex
Index of the image in the icon list (see Remarks)
CallbackFunction

Function to call when this item is selected (see Remarks)

UpdateCallbackFunction
Optional function that controls the state of the item; if specified, then SOLIDWORKS calls this function before displaying the item

If UpdateCallbackFunction returns...

Then SOLIDWORKS...

0

Deselects and disables the item

1

Deselects and enables the item; this is the default state if no update function is specified

2

Selects and disables the item

3

Selects and enables the item

4

Hides the item
(see Remarks)

Return Value

Index of the item within the flyout as assigned by SOLIDWORKS

Example

Remarks

See Add-in Callback and Enable Methods  to learn how to specify CallbackFunction and UpdateCallbackFunction.

Flyouts are created at runtime. Call this method from the callback method defined in ICommandManager::CreateFlyoutGroup.

 ImageListIndex is 0-based. The size of the index is equal to the number of images in the large or small graphic file for that flyout. See IFlyoutGroup::LargeIconList and IFlyoutGroup::SmallIconList for details.

 

See Also

Availability

SOLIDWORKS 2011 FCS, Revision Number 19.0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   AddCommandItem Method (IFlyoutGroup)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2017 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.