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
Xiaoliang Ma
NA
6
3k
WPF, count number of empty textbox and ComboBox
Jul 26 2018 9:24 PM
I have a C# WPF application with 400+ textbox and combo box. I need to count number of empty or null textbox and combo box. i have below code to count. but the problem is i have 400+ tests. It doesnt look like "smart" code if I follow the same way to count 400+ textboxes. Is there a better way to handle this case? Any help are much appreciated
int i = 0;
if (!String.IsEmptyorNull(txtBox1.Text))
{
i++;
}
else
{
if (!String.IsNullOrEmpty(txtBox2.Text))
i++;
}
txtTotal = i.ToString();
Reply
Answers (
1
)
Timestamp Access Time
how access hidden filed value in web method method in c#