TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Daniel
NA
66
0
Windows Forms - Iterating through controls on a form
Jun 14 2007 2:07 PM
I have a form with many groupboxes (18) and within each groupbox are controls (textboxes and checkboxes). When the user clicks the "NEW" button, I want to clear all controls on the form for data entry. I figured I would generically iterate through all the controls on the form and clear the information accordingly (set textbox.text = "" or checkbox.checked == false). I can get to all the groupboxes but can figure out how to iterate the controls within each groupbox. Here is my psuedo code: foreach (Control c in this.Controls) { //check for a groupbox if (c is GroupBox) { } }
Reply
Answers (
6
)
Automatically replace or remove a particular character in DataGridView
Handling Events