Answered by:
Forms not showing up

Question
-
I have built an application where there is a MDI parent form and other forms which i have not declared as Child forms but have set these forms not to show in Taskbar. While the application is running, if i have any of these forms open and i switch over to any other application other than this and when i come back to it, all these forms hide. I cannot reopen it or see it anymore.. Why is this happening?? how can i sustain these forms as it is even when i leave the application.
LuxCoderSaturday, January 2, 2010 7:25 AM
Answers
-
For sure :
Private Sub MDIParent_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Activated For Each f As Form In My.Application.OpenForms f.Activate() Next End Sub
Regards,
Mathieu Francesch Sharplog Engineering www.sharplog.fr- Marked as answer by LuxCoder Saturday, January 2, 2010 2:05 PM
Saturday, January 2, 2010 10:48 AM
All replies
-
You want to show them as mdi child ?
you want them to be shown as normal forms ?
what happens if you pres Alt+Tab combination when other forms [apparently] get vanished ?
Thanks
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
♦ My Blog ♦ My Facebook ♦Saturday, January 2, 2010 7:47 AM -
If you are not showing the form in taskbar and are not mdi child, then it would be better to open the form as modal. You can use FormObject.ShowDialog instead of FormObject.Show.
Gaurav KhannaSaturday, January 2, 2010 7:48 AM -
Those forms doesn't hide but they are deactivated when you switch to any other application.
Add an Activated event for your MDI parent form and add:
formx.Activate();
formy.Activate();
......
Replace formx & formy with names of those forms.
Thanks- Proposed as answer by Mathieu Francesch Saturday, January 2, 2010 9:09 AM
Saturday, January 2, 2010 7:55 AM -
Hi,
Use activate Event for your MDI Parent is a good solution.
You can list all open form with Application.OpenForms (sorry for C#):
private void MDIParent_Activated(object sender, EventArgs e) { foreach (Form f in Application.OpenForms) { f.Activate(); } }
Regards,
Mathieu Francesch Sharplog Engineering www.sharplog.fr- Proposed as answer by farooqaaa Saturday, January 2, 2010 9:08 AM
- Proposed as answer by Mathieu Francesch Saturday, January 2, 2010 9:08 AM
Saturday, January 2, 2010 9:07 AM -
The MDI parent uses its own taskbar
Success
CorSaturday, January 2, 2010 9:19 AM -
Thanks for reply!
Could you give me vb.net version of this code?
LuxCoderSaturday, January 2, 2010 10:43 AM -
Thanks for the reply.
FormObject.ShowDialog appears to be a good option. Does this work only when i open forms from MDI parent or can i use this to open forms from MDI child as well?
LuxCoderSaturday, January 2, 2010 10:46 AM -
For sure :
Private Sub MDIParent_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Activated For Each f As Form In My.Application.OpenForms f.Activate() Next End Sub
Regards,
Mathieu Francesch Sharplog Engineering www.sharplog.fr- Marked as answer by LuxCoder Saturday, January 2, 2010 2:05 PM
Saturday, January 2, 2010 10:48 AM -
You can use ShowDialog to open any form whether it is a child form or a non-child form.
Gaurav KhannaSaturday, January 2, 2010 11:20 AM