Home All Groups Group Topic Archive Search About

How to show a new form.

Author
21 Jan 2006 10:29 AM
bokiteam
Hi All,

In VB6, I can show/hide form by visable.show.

It didn't work on VB.net, could you please advice,

I have a form2, I want to show it after click button 1 in form1.

Thank you very much!

Best regards,
Boki.

Author
21 Jan 2006 11:49 AM
Ken Tucker [MVP]
Hi,

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
        ' in vb 2005 this will work Form2.Show()
        Dim frm As New Form2
        frm.Show()
    End Sub

Ken
------------------
<bokit***@ms21.hinet.net> wrote in message
Show quoteHide quote
news:1137839362.998512.178650@g49g2000cwa.googlegroups.com...
> Hi All,
>
> In VB6, I can show/hide form by visable.show.
>
> It didn't work on VB.net, could you please advice,
>
> I have a form2, I want to show it after click button 1 in form1.
>
> Thank you very much!
>
> Best regards,
> Boki.
>
Author
21 Jan 2006 12:36 PM
Herfried K. Wagner [MVP]
<bokit***@ms21.hinet.net> schrieb:
> In VB6, I can show/hide form by visable.show.
>
> It didn't work on VB.net, could you please advice,
>
> I have a form2, I want to show it after click button 1 in form1.

\\\
Dim f As New Form1()
f.Show()
///

and/or in .NET 2.0:

\\\
My.Forms.Form1.Show()
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>