Combobox SelectionChangeCommitted event does not work with arrows

I have a combobox with the DropDownList property that fires some code in the SelectionChangeCommitted event. It works fine with a mouse click, but if I try to select using the arrow keys that it launches after the first keystroke. How to make it work as a standard drop-down menu that can be moved with the mouse and keys?

 private void dd_jobs_SelectionChangeCommitted(object sender, EventArgs e) { Pk_Error p = new Pk_Error(ref_num, j[dd_jobs.SelectedIndex]); p.Show(); p.BringToFront(); this.Close(); } 
+4
source share
1 answer

I had the same problem to stick to 508 compliance. I had to implement a combobox that inherits one from windows and redefines functionality.

Capturing selected text in an OnEnter call and using it during OnLeave to make changes. Override OnSelectionChangeCommitted to see if the list has fallen and choices are made.

  if(this.DroppedDown == true) { base.OnSelectionChangeCommitted (e); sCurrentItem = this.Text; } 
0
source

Source: https://habr.com/ru/post/1432816/


All Articles