Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.

ModulePage.ContextMenuStrip-Eigenschaft

Aktualisiert: November 2007

Gets or sets the shortcut menu for the page.

Namespace:  Microsoft.Web.Management.Client.Win32
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)

public override ContextMenuStrip ContextMenuStrip { get; set; }
/** @property */
public ContextMenuStrip get_ContextMenuStrip()
/** @property */
public  void set_ContextMenuStrip(ContextMenuStrip value)

public override function get ContextMenuStrip () : ContextMenuStrip
public override function set ContextMenuStrip (value : ContextMenuStrip)

Eigenschaftenwert

Typ: System.Windows.Forms.ContextMenuStrip
A System.Windows.Forms.ContextMenuStrip object, or null if a value has not been assigned.

The following example creates a shortcut menu and populates it with controls.

void initCntxMenu() {

    ContextMenuStrip = new ContextMenuStrip();
    InitializeComponent2();
}


...


internal partial class DemoPage : ModulePage {
    private ToolStripMenuItem _tsm1;
    private ToolStripMenuItem _tsm2;
    private ToolStripMenuItem _tsm3;

    private void InitializeComponent2() {
        _tsm1 = new System.Windows.Forms.ToolStripMenuItem();
        _tsm2 = new System.Windows.Forms.ToolStripMenuItem();
        _tsm3 = new System.Windows.Forms.ToolStripMenuItem();
        // 
        // contextMenuStrip1
        // 
        ContextMenuStrip.Items.AddRange(
            new System.Windows.Forms.ToolStripItem[] {
        _tsm1,
        _tsm2,
        _tsm3});
        ContextMenuStrip.Name = "contextMenuStrip1";
        ContextMenuStrip.Size = new System.Drawing.Size(180, 70);
        // 
        // _tsm1
        // 
        _tsm1.Name = "_tsm1";
        _tsm1.Size = new System.Drawing.Size(179, 22);
        _tsm1.Text = "_tsm1 info";
        _tsm1.Click += new EventHandler(_tsm1_Click);
        // 
        // _tsm2
        // 
        _tsm2.Name = "_tsm2";
        _tsm2.Size = new System.Drawing.Size(179, 22);
        _tsm2.Text = "_tsm2 any questions?";
        // 
        // _tsm3
        // 
        _tsm3.Name = "_tsm3";
        _tsm3.Size = new System.Drawing.Size(179, 22);
        _tsm3.Text = "_tsm3 the end";
        // 
        // Form1
        // 
        ContextMenuStrip.ResumeLayout(false);

    }

    void _tsm1_Click(object sender, EventArgs e) {
        MessageBox.Show("congrad", sender.ToString());
    }
}


Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

.NET Framework

Unterstützt in: 3.5, 3.0
Anzeigen: