public ComboBoxCustomDropdown() { this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; this._listcontrol = new ListControlCustom(); this._listcontrol.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; this._listcontrol.Dock = DockStyle.Fill; this._listcontrol.Visible = true; this._listcontrol.SelectedIndexChanged += _listcontrol_SelectedIndexChanged; this._listcontrol.Margin = new Padding(0); this.Padding = new Padding(0); this.Controls.Add(this._listcontrol); }
public DropDownCustom(string name = "", bool closeondeact = true) { closeondeactivate = closeondeact; this.FormBorderStyle = FormBorderStyle.None; this.ShowInTaskbar = false; this._listcontrol = new ListControlCustom(); this.Name = this._listcontrol.Name = name; this._listcontrol.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; this._listcontrol.Dock = DockStyle.Fill; this._listcontrol.Visible = true; this._listcontrol.SelectedIndexChanged += _listcontrol_SelectedIndexChanged; this._listcontrol.KeyPressed += _listcontrol_KeyPressed; this._listcontrol.OtherKeyPressed += _listcontrol_OtherKeyPressed; this._listcontrol.Margin = new Padding(0); this.Padding = new Padding(0); this.Controls.Add(this._listcontrol); }