private void metroToolbar1_ItemClicked(object sender, MetroFramework.Extender.MetroToolbarButtonType e) { switch (e) { case MetroToolbarButtonType.Execute: OnExecuteEvent(); break; case MetroToolbarButtonType.Exit: OnExitEvent(); break; } }
private void metroToolbar1_ItemClicked(object sender, MetroFramework.Extender.MetroToolbarButtonType e) { var btn = sender as IMetroToolBarButton; switch (btn.ButtonType) { case MetroToolbarButtonType.Exit: this.Close(); return; case MetroToolbarButtonType.Save: CreateSerial(); break; case MetroToolbarButtonType.Search: if (openDialog.ShowDialog() == DialogResult.OK) { LoadDataFromMenu(openDialog.FileName); } break; } }