protected override void OnMouseClick(MouseEventArgs e) { base.OnMouseClick(e); if (e.X >= Width - SelectionSize && e.Y >= Height - SelectionSize) { if (dropdown == false) { int fittableitems = this.DropDownHeight / this.ItemHeight; if (fittableitems == 0) { fittableitems = 5; } if (fittableitems > this.Items.Count()) // no point doing more than we have.. { fittableitems = this.Items.Count(); } ddc.Size = new Size(this.DropDownWidth > 9 ? this.DropDownWidth : this.Width, fittableitems * this.ItemHeight + 4); ddc.Show(FindForm()); } else { ddc.Hide(); } dropdown = !dropdown; } }
protected override void OnMouseClick(MouseEventArgs e) { base.OnMouseClick(e); if (e.X >= Width - SelectionSize && e.Y >= Height - SelectionSize) { if (dropdown == false) { ddc.PositionBelow(this, this.Width); ddc.RightAlignedToLocation = true; System.Diagnostics.Debug.WriteLine("dcc border " + ddc.BorderColor); ddc.Show(FindForm()); } else { ddc.Hide(); } dropdown = !dropdown; } }