jsn

Add in and regular windows form

Discussion created by jsn on Aug 23, 2011
Latest reply on Aug 24, 2011 by jsn
Hi all

when I open a windows form from a button loaced in the toolbar how can I hide the form if the button gets clicked again?

I tried that but it does not work, it opens new windwos forms.

Protected Overrides Sub OnClick()
        Dim myForm As frmWindowsForm


        If myForm Is Nothing Then
            myForm = New frmWindowsForm



        End If


        If myForm.Visible Then
            myForm.Hide()
        Else
            myForm.Show()


        End If

        myForm = Nothing


    End Sub

Outcomes