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
Kanimozhi Shivakumar
NA
293
152.8k
Validating Event is firing when Close button(Form "Button")
Jul 19 2018 6:14 AM
Hi ,
In my project , I have one MDI Parent form and n number of child forms..I can open multiple child forms on my screen.
I have Form1 and it has two text boxes which is mandatory to enter. When the text box value is not entered , the cursor should not allow to focus on next control..So I have written validating event (as mentioned below) :
private
void
txtCod_Validating(
object
sender, CancelEventArgs e)
{
try
{
if
(clsMdiForm.blnBlankCheck(txtCode.Text,
false
,
"CODE"
))
{
e.Cancel =
true
;
}
else
{
e.Cancel = blnChkUniqueLoc(0);
}
}
catch
(Exception ex)
{
clsMdiForm.writeErrorLog(ex.HResult.ToString(), ex.Message,
"txtCod_Validating"
,
"frmMaLocation"
);
}
}
I opened the form1 and cursor is focused in textbox1 which contains empty value. I am trying to close my form1 / trying to open different form but it is going to form1 textbox1 validating event..
As per my requirement it should allow to close the form and allow to open some other forms also..
I am not getting the solution so I keep the bugs in deferred status..Please some one help me to sort out this issue.
Reply
Answers (
1
)
multi select combobox
visual Studio 2015 setup file with database