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
Dorababu Meka
226
8.3k
1.7m
Display an error with tool tip
Jun 21 2010 6:27 AM
I have written a code for validating text boxes as follows
public class TestClass
{
public void RequiredText(TextBox txt, ToolTip newtoolTip)
{
if (txt.Text != string.Empty)
{
//txt.Text = "Required";
txt.BackColor = System.Drawing.Color.White;
newtoolTip.Hide(txt);
}
else
{
txt.BackColor = System.Drawing.Color.Tomato;
newtoolTip.Show("Required", txt);
}
}
}
In textbox validating i use this
private void textBox2_Validating(object sender, CancelEventArgs e)
{
TestClass test = new TestClass();
test.RequiredText(textBox2, toolTip1);
}
Now what i need is when i click on submit i would like to display error message for the text boxes that are left empty . If success i would like to save the record. Any idea please
Reply
Answers (
3
)
MDI Form
Suggestions for building a small windows application