how many ways to bring up a form/window?

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hi all,

I am new to VB.NET. My program has two forms, if user clicks an "OK"
button
in Form1, the From2 will be brought to front.
I found there are three methods of the Form class related to it:

Form2.Activate()
Form2.BringToFront()
Form2.Show()

Which one/ones should I use?

Thanks,

James
 
James said:
I am new to VB.NET. My program has two forms, if user clicks an "OK"
button
in Form1, the From2 will be brought to front.
I found there are three methods of the Form class related to it:

Form2.Activate()
Form2.BringToFront()
Form2.Show()

Which one/ones should I use?

'BringToFront' is inherited from 'Control', 'Show' is used to /show/ a maybe
hidden form. Thus I vote for using 'Activate' if the form is already open.
 
Herfried said:
'BringToFront' is inherited from 'Control', 'Show' is used to /show/ a maybe
hidden form. Thus I vote for using 'Activate' if the form is already open.
However, when Form2 is minimized, "Activate" will not bring
Form2 up and to front. Any hints?

Thanks.
 
Back
Top