///use this to cycle through the controls collection and clear all textboxes private void btnClear_Click(object sender, EventArgs e) { //---this sub finds all the textboxes on the form and clears them! It searches through the controls collection and when // it finds a textbox, it clears it. //---dim a temp object variable as a control object. It can be a button, listbox, textbox, etc. foreach (Control myControl in Controls) //loop through the form's control collection to find all the textboxes. { if (myControl is TextBox) //found textbox? then clear text myControl.Text = ""; } txtNumber1.Focus(); }