Your technology certification is waiting. Enroll in Cloud Class ®
private void Form1_Load(object sender, EventArgs e)
foreach (Control cntrl in GetControls(this))
cntrl.Click += ClickHandler;
public List<Control> GetControls(Control form)
List<Control> controlList = new List<Control>();
foreach (Control childControl in form.Controls)
// Recurse child controls.
private void ClickHandler(object sender, EventArgs e)
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.