본문으로 건너뛰기

ToolbarMain

public ToolStrip ToolbarMain { get; }

Toolbar - Main

Returns

TypeDescription
ToolStrip

Examples

// 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);
}