public RecentlyUsedComboBox(MostRecentlyUsed items, ComboBox combo) { this._values = items; items.RecentItemsChanged += OnRecentItemsChanged; this._box = combo; this._box.SelectedIndexChanged += new EventHandler(OnSelectedIndexChanged); this._box.KeyDown += new KeyEventHandler(OnComboKeyDown); this._box.LostFocus += new EventHandler(OnComboLostFocus); this._box.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this._box.AutoCompleteSource = AutoCompleteSource.CustomSource; this._values.RecentItemSelected += OnRecentSelected; }
public FormSearch() { this.SetStyle(ControlStyles.Selectable, true); this.KeyPreview = true; InitializeComponent(); this.buttonFindNext.Click += new EventHandler(buttonFindNext_Click); this.buttonReplace.Click += new EventHandler(buttonReplace_Click); this.buttonReplaceAll.Click += new EventHandler(buttonReplaceAll_Click); this.comboBoxFind.KeyDown += new KeyEventHandler(comboBoxFind_KeyDown); this.comboBoxFilter.Items.AddRange(new object[] { SearchFilter.Everything, SearchFilter.Names, SearchFilter.Text, SearchFilter.Comments }); this.comboBoxFilter.SelectedItem = this._filter; this.comboBoxFilter.SelectedValueChanged += new EventHandler(comboBoxFilter_SelectedValueChanged); this._tnav = new TabNavigator(this); _recentFindStrings = new MostRecentlyUsed(); _recentFindCombo = new RecentlyUsedComboBox(_recentFindStrings, this.comboBoxFind); _recentFindCombo.SelectFirstItemByDefault = false; _recentReplaceStrings = new MostRecentlyUsed(); _recentReplaceCombo = new RecentlyUsedComboBox(_recentReplaceStrings, this.comboBoxReplace); _recentReplaceCombo.SelectFirstItemByDefault = false; }