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
Bineesh Viswanath
1.3k
428
43.8k
Form not closing in Form.Close() function
Sep 12 2019 7:56 AM
Dear All,
I need your help to solve below issue:-
I have an issue when I am trying to close a windows form by calling form.close() function.
The scenario is mentioned below:-
I am using a mdi form. From menu I opened a child form. Then from child form(child), I opened another form(non -child)outside the container. in non child form I am using a database insert function. After insert, I am closing the non child form and I need to re open the child form in order to reflect the data saved from non child form.
in non child form , I wrote like this:-
frmMain mainObj = new frmMain();
Close();
mainObj.OpenAssetViewForm();
And in Main form , i wrote like this to open child form within container.
public
void
OpenAssetViewForm()
{
try
{
foreach
(Form frmObj
in
Application.OpenForms)
{
if
(frmObj.Name ==
"frmAssetRegView"
)
{
frmObj.Close();
if
(frmObj ==
null
)
// is not changing into null
{
frmObj.Show();
}
break
;
}
}
}
catch
(Exception ex)
{
}
}
Reply
Answers (
8
)
Pizza Order Form
Howto solve Notification Icon Disappear On Mouse Hover Issue