private Button CreateControl(Hotspot hotspot) { Button hotspotButton = new Button(); hotspotButton.Click += new EventHandler(hotspotButton_Click); hotspotButton.Image = null; hotspotButton.Text = hotspot.ImageName; return(hotspotButton); }
private void btnAddNewHotspot_Click(object sender, EventArgs e) { Hotspot newHotSpot = new Hotspot(); HotSpotCtrl ctrl = CreateControl(newHotSpot); pnlHotspots.Controls.Add(ctrl); HotspotManager.Hotspots.Add(newHotSpot); HotspotManager.Save(); }
private HotSpotCtrl CreateControl(Hotspot hotSpot) { HotSpotCtrl ctrl = new HotSpotCtrl(); ctrl.ControlClicked += new EventHandler(ctrl_ControlClicked); ctrl.HotSpot = hotSpot; ctrl.IsSelected = false; ctrl.LoadControl(); ctrl.Collapse(); return(ctrl); }