System.Windows.Forms.ComboBox.OnKeyPress C# (CSharp) Method

OnKeyPress() protected method

protected OnKeyPress ( KeyPressEventArgs e ) : void
e KeyPressEventArgs
return void
		protected override void OnKeyPress (KeyPressEventArgs e)
		{
			if (dropdown_style == ComboBoxStyle.DropDownList)
			{
				int index = FindStringCaseInsensitive (e.KeyChar.ToString (), SelectedIndex + 1);
				if (index != -1)
				{
					SelectedIndex = index;
					if (DroppedDown)
					{
						//Scroll into view
						//TODO
						//if (SelectedIndex >= listbox_ctrl.LastVisibleItem ())
						//	listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.LastVisibleItem () + 1);
						// Or, selecting an item earlier in the list.
						//if (SelectedIndex < listbox_ctrl.FirstVisibleItem ())
						//	listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.FirstVisibleItem ());
					}
				}
			}
			
			base.OnKeyPress (e);
		}