Click or drag to resize

VIZCore3DControlToolbarMain Property

Toolbar - Main

Namespace:  VIZCore3D.NET
Assembly:  VIZCore3D.NET (in VIZCore3D.NET.dll) Version: 2.8.24.1104 (2.8.24.1104)
Syntax
C#
public ToolStrip ToolbarMain { get; }

Property Value

Type: ToolStrip
Examples
C#
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

private void MoveToolbarItem()
{
    // Main Toolbar Item Count
    int maxIndex = vizcore3d.ToolbarMain.Items.Count;

    // Add Separator Control
    vizcore3d.ToolbarMain.Items.Add(new ToolStripSeparator());
    maxIndex++;

    // Note Toolbar Item Count
    int count = vizcore3d.ToolbarNote.Items.Count;

    // Insert Item
    for (int i = count; i > 0; i--)
    {
        // Insert : Moved Item
        vizcore3d.ToolbarMain.Items.Insert(
            maxIndex // Index to be inserted
            , vizcore3d.ToolbarNote.Items[i - 1] // Item Index
            );
    }

    // Hide Toolbar : Empty Item
    vizcore3d.ToolbarNote.Visible = false;
}

private void AddNewItem()
{
    // Add Separator Control
    vizcore3d.ToolbarMain.Items.Add(new ToolStripSeparator());

    ToolStripItem item = new ToolStripMenuItem();

    //Name that will apear on the menu
    item.Text = "New Button";

    //Put in the Name property whatever neccessery to retrive your data on click event
    item.Name = "btnNewItem";

    //On-Click event
    item.Click += Item_Click;

    //Add the submenu to the parent menu
    vizcore3d.ToolbarMain.Items.Add(item);
}

private void Item_Click(object sender, EventArgs e)
{
    MessageBox.Show("Clicked.", "VIZCore3D.NET", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
See Also