public HatchBrushMenu() { Text = "Hatch Brush Menu"; ResizeRedraw = true; Menu = new MainMenu(); Menu.MenuItems.Add("&Hatch-Style"); for (HatchStyle hs = (HatchStyle)iMin; hs <= (HatchStyle)iMax; hs++) { HatchStyleMenuItem hsmi = new HatchStyleMenuItem(); hsmi.HatchStyle = hs; hsmi.Click += new EventHandler(MenuHatchStyleOnClick); if ((int)hs % 8 == 0) { hsmi.BarBreak = true; } Menu.MenuItems[0].MenuItems.Add(hsmi); } hsmiChecked = (HatchStyleMenuItem)Menu.MenuItems[0].MenuItems[0]; hsmiChecked.Checked = true; }
void MenuHatchStyleOnClick(object obj, EventArgs ea) { hsmiChecked.Checked = false; hsmiChecked = (HatchStyleMenuItem)obj; hsmiChecked.Checked = true; Invalidate(); }
private void MenuHatchStyleOnClick(object sender, EventArgs e) { hsmiChecked.Checked = false; hsmiChecked = (HatchStyleMenuItem)sender; hsmiChecked.Checked = true; Invalidate(); }