Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
edited body
Source Link
nawfal
  • 73.8k
  • 59
  • 342
  • 379

IA simple recursive function should do it.

private void AddEvent(Control parentCtrl) { foreach (Control c in parentCtrl.Controls) { c.KeyDown += new KeyEventHandler(c_KeyDown); AddEvent(c); } } 

I simple recursive function should do it.

private void AddEvent(Control parentCtrl) { foreach (Control c in parentCtrl.Controls) { c.KeyDown += new KeyEventHandler(c_KeyDown); AddEvent(c); } } 

A simple recursive function should do it.

private void AddEvent(Control parentCtrl) { foreach (Control c in parentCtrl.Controls) { c.KeyDown += new KeyEventHandler(c_KeyDown); AddEvent(c); } } 
added 9 characters in body
Source Link
Magnus
  • 47.3k
  • 8
  • 88
  • 128

I simple recursive function should do it.

private void AddEvent(Control parentCtrl) { foreach (Control c in parentCtrl.Controls) { c.KeyDown += new KeyEventHandler(c_KeyDown); AddEvent(c); } } 

I simple recursive function should do it.

private void AddEvent(Control parentCtrl) { foreach (Control c in parentCtrl) { c.KeyDown += new KeyEventHandler(c_KeyDown); AddEvent(c); } } 

I simple recursive function should do it.

private void AddEvent(Control parentCtrl) { foreach (Control c in parentCtrl.Controls) { c.KeyDown += new KeyEventHandler(c_KeyDown); AddEvent(c); } } 
Source Link
Magnus
  • 47.3k
  • 8
  • 88
  • 128

I simple recursive function should do it.

private void AddEvent(Control parentCtrl) { foreach (Control c in parentCtrl) { c.KeyDown += new KeyEventHandler(c_KeyDown); AddEvent(c); } }