Showing several windows form.

Hi,

I have a mdiform and several windows form.

I call form2 from form1.
Form1 is larger than form2.
When I click form1 then the form2 is disappear (it is behind the form1).

How I could show the form2 which is user friendly when I need to show it again?.

Thank you.
LVL 1
emi_sastraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
form2.show
form2.activate
0
emi_sastraAuthor Commented:
Hi,

I don't get it.
Would you please explain?

Thank you.
0
Éric MoreauSenior .Net ConsultantCommented:
you asked how you can show the form, when you need it, use this code:
form2.show
form2.activate
0
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

emi_sastraAuthor Commented:
Hi,

I mean why form2.show together with form2.activate?
Where to put it, on form1, at what event?

Thank you.
0
Éric MoreauSenior .Net ConsultantCommented:
when you need it. What makes your application to need it? a press of a button?
0
srinivasbnCommented:
Hi

If you add the MDIform, if you open multiple child forms then in the window option automatically the list of forms will be appeared. So same way do the same thing. So when ever you require to change another form just select that form like in word document.
0
emi_sastraAuthor Commented:
Hi,

Why we need to form2.show?
When I press button from form1, the form2 is shown.
So, the form2 is activated, then I click form1 again, then form2 is disappeared.

Why we need to form2.show, hasn't it shown already?

I put :

  Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        MsgBox("Form2 Show")
    End Sub

The message is kept showing, can not be stopped till I stop debugging?

Sometimes I need to refresh combobox when activated form is activated, and I put it in Form_Activated, could it be a problem?

Thank you.

0
Éric MoreauSenior .Net ConsultantCommented:
>>Why we need to form2.show, hasn't it shown already?

Show loads the form (if not already loaded) and displays it.
Activate will give the focus to the form.

>>Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        MsgBox("Form2 Show")
    End Sub

This is a bad idea because when you close the message box, the form the get the focus and gets reactivated. This is why you are looping.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
emi_sastraAuthor Commented:
Hi,

Yes, without messagebox, it just occurs once.

Thank you very much for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.