Skip to main content
More affirmative answer (this is not a forum - see e.g. <http://meta.stackexchange.com/a/92115>. It is a think tank (see <http://meta.stackoverflow.com/a/325681>).
Source Link
Peter Mortensen
  • 31.2k
  • 22
  • 111
  • 134

Have you triedTry to just addingadd the TextBox to the main form instead of the DGV?DataGridView:

Controls.Add(txt);
Controls.Add(dgv);

txt.PreviewKeyDown += DgvOnPreviewKeyDown;
txt.KeyDown += DgvOnKeyDown;
        
txt.PreviewKeyDown += TxtOnPreviewKeyDown;
txt.KeyDown += TxtOnKeyDown;

Have you tried just adding the TextBox to the main form instead of the DGV?

Controls.Add(txt);
Controls.Add(dgv);

txt.PreviewKeyDown += DgvOnPreviewKeyDown;
txt.KeyDown += DgvOnKeyDown;
        
txt.PreviewKeyDown += TxtOnPreviewKeyDown;
txt.KeyDown += TxtOnKeyDown;

Try to just add the TextBox to the main form instead of the DataGridView:

Controls.Add(txt);
Controls.Add(dgv);

txt.PreviewKeyDown += DgvOnPreviewKeyDown;
txt.KeyDown += DgvOnKeyDown;

txt.PreviewKeyDown += TxtOnPreviewKeyDown;
txt.KeyDown += TxtOnKeyDown;
Source Link
David
  • 1.9k
  • 1
  • 20
  • 25

Have you tried just adding the TextBox to the main form instead of the DGV?

Controls.Add(txt);
Controls.Add(dgv);

txt.PreviewKeyDown += DgvOnPreviewKeyDown;
txt.KeyDown += DgvOnKeyDown;
        
txt.PreviewKeyDown += TxtOnPreviewKeyDown;
txt.KeyDown += TxtOnKeyDown;