MenuCommand::Supported Property
.NET Framework (current version)
Gets or sets a value indicating whether this menu item is supported.
Assembly: System (in System.dll)
Property Value
Type: System::Booleantrue if the item is supported, which is the default; otherwise, false.
The following code example creates a MenuCommand object, configures its properties, and adds it to the IMenuCommandService.
public ref class CDesigner: public ComponentDesigner { public: [PermissionSetAttribute(SecurityAction::Demand, Name="FullTrust")] virtual void Initialize( IComponent^ comp ) override { ComponentDesigner::Initialize( comp ); IMenuCommandService^ mcs = static_cast<IMenuCommandService^>(comp->Site->GetService( IMenuCommandService::typeid )); MenuCommand^ mc = gcnew MenuCommand( gcnew EventHandler( this, &CDesigner::OnF1Help ),StandardCommands::F1Help ); mc->Enabled = true; mc->Visible = true; mc->Supported = true; mcs->AddCommand( mc ); System::Windows::Forms::MessageBox::Show( "Initialize() has been invoked." ); } private: void OnF1Help( Object^ /*sender*/, EventArgs^ /*e*/ ) { System::Windows::Forms::MessageBox::Show( "F1Help has been invoked." ); } }; }
.NET Framework
Available since 1.1
Available since 1.1
Show: