public AutocompleteMenuHost(AutocompleteMenu menu) { AutoClose = false; AutoSize = false; Margin = Padding.Empty; Padding = Padding.Empty; Menu = menu; ListView = new AutocompleteListView(); }
public void SetAutocompleteMenu(Control control, AutocompleteMenu menu) { if (menu != null) { ITextBoxWrapper wrapper = menu.CreateWrapper(control); if (wrapper == null) return; // menu.SubscribeForm(wrapper); AutocompleteMenuByControls[control] = this; // wrapper.LostFocus += menu.control_LostFocus; wrapper.Scroll += menu.control_Scroll; wrapper.KeyDown += menu.control_KeyDown; wrapper.MouseDown += menu.control_MouseDown; } else { AutocompleteMenuByControls.TryGetValue(control, out menu); AutocompleteMenuByControls.Remove(control); ITextBoxWrapper wrapper = null; WrapperByControls.TryGetValue(control, out wrapper); WrapperByControls.Remove(control); if (wrapper != null && menu != null) { wrapper.LostFocus -= menu.control_LostFocus; wrapper.Scroll -= menu.control_Scroll; wrapper.KeyDown -= menu.control_KeyDown; wrapper.MouseDown -= menu.control_MouseDown; } } }
public SyntaxRichTextBox() { Intelisense = new AutocompleteMenu(); }