void VirtualControlContainer_MouseMove(object sender, MouseEventArgs e) { var ctl = this.controls.Find(m => m.Rectangle.Contains(e.Location)); if (ctl == null) { if (ctlIn != null) { ctlIn.OnMouseLeave(e); ctlIn = null; } } else { if (ctlIn == null) { ctlIn = ctl; ctlIn.OnMouseEnter(e); } } }
public void RemoveControl(VirtualControl control) { this.controls.Remove(control); }
public void AddControl(VirtualControl control) { control.Parent = this; this.controls.Add(control); }