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
Mohamed Said
NA
58
6.1k
How to validate and focus each text box alone
Nov 9 2017 8:48 AM
- i have two Texbox (1)Name, (2)Code. i want to validate each textbox alone but the code didn't work. every time show the first messagebox when i repeat Name OR Code
Code:-
if (dt.Rows.Count > 0 || dt2.Rows.Count > 0)
{
if (dt.Rows.Count > 0)
{
MessageBox.Show("this Name was inserted !", "Warning ", MessageBoxButtons.OK, MessageBoxIcon.Warning);
txt_Name.Focus();
txt_Name.SelectionStart = 0;
txt_Name.SelectionLength = txt_Name.TextLength;
return;
}
else if (dt2.Rows.Count > 0)
{
MessageBox.Show("That Code was inserted !", "Warning ", MessageBoxButtons.OK, MessageBoxIcon.Warning);
txt_Code.Focus();
txt_Code.SelectionStart = 0;
txt_Code.SelectionLength = txt_Code.TextLength;
return;
}
}
Reply
Answers (
1
)
Add Windows Form Login Page
how to Display Images in Rdlc Textbox in windows application