![]() | Type | Description | ||
| Command as Long | A Long expression that indicates the identifier of the command being selected. |
The following VB sample displays a message box when the user changes the view mode:
Dim nVM As EXSHELLVIEWLibCtl.ViewModeType
Private Sub ExShellView1_InvokeItemMenu(ByVal Command As Long)
If (nVM <> ExShellView1.ViewMode) Then
nVM = ExShellView1.ViewMode
MsgBox "ViewMode changed to " & nVM
End If
End Sub
Private Sub Form_Load()
nVM = ExShellView1.ViewMode
End Sub
The sample holds the current view mode when the application starts on nVM variable. Once the InvokeItemMenu event occurs, the nVM variable is checked with the current view mode, and if it changed, a message box is displayed that the user has changed the view mode.
The following C# sample displays a message box once the user changes the control's view mode:
public Form1()
{
InitializeComponent();
nVM = exshellview1.ViewMode;
}
exontrol.EXSHELLVIEWLib.ViewModeType nVM = exontrol.EXSHELLVIEWLib.ViewModeType.Details;
private void exshellview1_InvokeItemMenu(object sender, int Command)
{
if ( nVM != exshellview1.ViewMode )
{
nVM = exshellview1.ViewMode;
MessageBox.Show( "ViewMode changed to " + nVM.ToString());
}
}The Values for the Command parameter are determined by the system, and are the same for any Windows version. For instance, the 30995 indicates a Rename operation, while the 30996 command invokes the Properties dialog of selected file or folder.
The following VB sample displays the command being performed:
Private Sub ExShellView1_InvokeItemMenu(ByVal Command As Long)
Debug.Print Command
End Sub