public WSNAutoCompleteTextBox() { // Create the form that will hold the list this.popup = new Form(); this.popup.SuspendLayout(); this.popup.StartPosition = FormStartPosition.Manual; this.popup.ShowInTaskbar = false; this.popup.FormBorderStyle = FormBorderStyle.None; //this.popup.TopMost = true; this.popup.ResumeLayout(); this.popup.Deactivate += new EventHandler(Popup_Deactivate); // Create the list box that will hold mathcing items this.list = new WSNAutoCompleteListBox(); this.list.Cursor = Cursors.Hand; this.list.BorderStyle = BorderStyle.None; this.list.SelectedIndexChanged += new EventHandler(List_SelectedIndexChanged); this.list.MouseDown += new MouseEventHandler(List_MouseDown); this.list.ItemHeight = 20; this.list.Dock = DockStyle.Fill; panel = new WSNAutoCompletePanel(); this.popup.Controls.Add(panel); panel.Dock = DockStyle.Fill; panel.Padding = new Padding(1); // Add the list box to the popup form panel.Controls.Add(this.list); // Add default triggers. this.triggers.Add(new TextLengthTrigger(1)); this.triggers.Add(new ShortCutTrigger(Keys.Enter, TriggerState.SelectAndConsume)); this.triggers.Add(new ShortCutTrigger(Keys.Tab, TriggerState.Select)); //this.triggers.Add(new ShortCutTrigger(Keys.Control | Keys.Space, TriggerState.ShowAndConsume)); this.triggers.Add(new ShortCutTrigger(Keys.Escape, TriggerState.HideAndConsume)); oldText = this.Text; this.LostFocus += new EventHandler(WSNAutoCompleteTextBox_LostFocus); InitTimer(); IsSpaceKeyCodeValid = false; }