Les deux révisions précédentesRévision précédente | |
lang:csharp:ihm:form:touches [2017/09/10 14:27] – maff => mhtml root | lang:csharp:ihm:form:touches [2020/04/28 23:02] (Version actuelle) – mhtml -> html root |
---|
Généralement, c'est l'événement ''KeyPress'' qui s'en occupe. Mais comme le TextBox ne s'occupe que des caractères alphanumériques, il faut utiliser l'événement ''PreviewKeyDown''. | Généralement, c'est l'événement ''KeyPress'' qui s'en occupe. Mais comme le TextBox ne s'occupe que des caractères alphanumériques, il faut utiliser l'événement ''PreviewKeyDown''. |
| |
[[http://stackoverflow.com/questions/1646998/up-down-left-and-right-arrow-keys-do-not-trigger-keydown-event|c# - Up, Down, Left and Right arrow keys do not trigger KeyDown event - Stack Overflow]], {{ :lang:csharp:ihm:form:touches:c_-_up_down_left_and_right_arrow_keys_do_not_trigger_keydown_event_-_stack_overflow.mhtml |Archive}} | [[http://stackoverflow.com/questions/1646998/up-down-left-and-right-arrow-keys-do-not-trigger-keydown-event|c# - Up, Down, Left and Right arrow keys do not trigger KeyDown event - Stack Overflow]] {{ :lang:csharp:ihm:form:touches:c_-_up_down_left_and_right_arrow_keys_do_not_trigger_keydown_event_-_stack_overflow_2020-04-28_10_55_41_pm_.html |Archive du 29/10/2009 le 28/04/2020}} |
| |
=====KeyDown, KeyPress, KeyUp===== | =====KeyDown, KeyPress, KeyUp===== |
Dans le cas d'un DataGridView, KeyDown, KeyPress et KeyUp ne marchent pas. | Dans le cas d'un DataGridView, KeyDown, KeyPress et KeyUp ne marchent pas. |
| |
En fouillant sur Internet ([[https://social.msdn.microsoft.com/Forums/windows/en-US/db486d50-48f3-405d-bc7a-ad3720d4dd57/datagridview-how-to-capture-a-cells-keypress-event?forum=winformsdatacontrols|DataGridView, how to capture a cell's KeyPress event...]], {{ :lang:csharp:ihm:form:touches:datagridview_how_to_capture_a_cell_s_keypress_event....mhtml |Archive}}), la solution suivante est préconisée : | En fouillant sur Internet ([[https://social.msdn.microsoft.com/Forums/windows/en-US/db486d50-48f3-405d-bc7a-ad3720d4dd57/datagridview-how-to-capture-a-cells-keypress-event?forum=winformsdatacontrols|DataGridView, how to capture a cell's KeyPress event...]] {{ :lang:csharp:ihm:form:touches:datagridview_how_to_capture_a_cell_s_keypress_event..._2020-04-28_10_55_40_pm_.html |Archive du 09/08/2005 le 28/04/2020}}), la solution suivante est préconisée : |
<code csharp> | <code csharp> |
private void MyDataGridViewInitializationMethod() | private void MyDataGridViewInitializationMethod() |