Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Form close/open

$
0
0
I have an application that if I click the help button it opens a new form for help instructions.
On this new form I have 2 buttons
one is next and one is close
if i click the next button i want to be able to close this help form and open the new one(2nd Help Form).
problem is on the 2nd help from I have a back button that should take me back to the 1st help form but I seems as though it is already open. I have tried .close, .hide.
Here is my code for the first help form
Code:

  Public Class Help
    Private Sub help_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Help2.Enabled() Then
            Help2.Close()
        End If
    End Sub

    Private Sub Hlp1BtnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hlp1BtnNext.Click
        Me.Hide()
        Help2.ShowDialog()
    End Sub

    Private Sub Hlp1BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hlp1BtnClose.Click
        Me.Close()
    End Sub
End Class

and the 2nd help form
Code:

    Public Class Help2
    Private Sub help2_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Help.Close()
    End Sub

    Private Sub Hlp2BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hlp2BtnClose.Click
        Me.Close()
    End Sub

    Private Sub Hlp2BtnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hlp2BtnNext.Click
        Help3.ShowDialog()
    End Sub

    Private Sub Hlp2BtnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hlp2BtnBack.Click
        Help.Enabled()
    End Sub
End Class


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>