Show&Hide (VB to .NET migration problem)

R

Radith Silva

Hi all;

Private Sub cmdShow_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdShow.Click
frmAbout.Show()
End Sub

Private Sub cmdHide_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdHide.Click
frmAbout.Hide()
End Sub

In VB 6.0 that would enable me to show and hide my second frame; what
would i need to do in .NET.

All help appreciated.

Cheers. Radith Silva
 
K

Ken Tucker [MVP]

Hi,

Dim frm As frmAbout


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

Try

frm.Show()

Catch

' frm does not exist make it equal to a new frmAbout

frm = New frmAbout

frm.Show()

End Try

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click

frm.Hide()

End Sub



Ken
 
H

Herfried K. Wagner [MVP]

* Radith Silva said:
Private Sub cmdShow_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdShow.Click
frmAbout.Show()
End Sub

Private Sub cmdHide_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdHide.Click
frmAbout.Hide()
End Sub

In VB 6.0 that would enable me to show and hide my second frame; what
would i need to do in .NET.

\\\
Private m_AboutForm As New AboutForm()
..
..
..
m_AboutForm.Show()
..
..
..
m_AboutForm.Hide()
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top