예제 #1
0
        public AutocompleteMenuHost(AutocompleteMenu menu)
        {
            AutoClose = false;
            AutoSize = false;
            Margin = Padding.Empty;
            Padding = Padding.Empty;

            Menu = menu;
            ListView = new AutocompleteListView();
        }
예제 #2
0
 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;
         }
     }
 }
예제 #3
0
 public SyntaxRichTextBox()
 {
     Intelisense = new AutocompleteMenu();
 }