Hi,
I need to be able to open a form from a button click but once open i need to stop the button opening another instance of that form until the first i closed.
This is what i have so far but it doesnt allow the form to open once.
If anyone could help me with where im going wrong i would really appreciate it.
Thanks
Carl
I need to be able to open a form from a button click but once open i need to stop the button opening another instance of that form until the first i closed.
This is what i have so far but it doesnt allow the form to open once.
VB.NET:
[size=2][color=#0000ff]
Private Sub [/color][/size][size=2]MapBClick(sender [/size][size=2][color=#0000ff]As [/color][/size][size=2]System.[/size][size=2][color=#0000ff]Object[/color][/size][size=2], e [/size][size=2][color=#0000ff]As [/color][/size][size=2]System.EventArgs)
[/size][size=2][color=#0000ff]Dim [/color][/size][size=2]iyardref [/size][size=2][color=#0000ff]As Integer [/color][/size][size=2]=f.intMapB
[/size][size=2][color=#0000ff]Dim [/color][/size][size=2]fFormMapDraw [/size][size=2][color=#0000ff]As new [/color][/size][size=2]mapdraw(iyardref)
[/size][size=2][color=#0000ff]If Not [/color][/size][size=2]IsNothing(fFormMapDraw) [/size][size=2][color=#0000ff]Then
If Not [/color][/size][size=2]fFormMapDraw.IsDisposed [/size][size=2][color=#0000ff]Then
[/color][/size][size=2]fFormMapDraw.WindowState = FormWindowState.[/size][size=2][color=#0000ff]Normal [/color][/size][size=2][color=#008000] [/color][/size][size=2] [/size]
[size=2] fFormMapDraw.BringToFront()[/size]
[size=2][color=#0000ff]Else
[/color][/size][size=2]fFormMapDraw = [/size][size=2][color=#0000ff]New [/color][/size][size=2]mapdraw(iyardref)
fFormMapDraw.Show()
fFormMapDraw.MdiParent = [/size][size=2][color=#0000ff]Me[/color][/size][size=2].MdiParent
[/size][size=2][color=#0000ff]End If
Else
[/color][/size][size=2]fFormMapDraw = [/size][size=2][color=#0000ff]New [/color][/size][size=2]mapdraw(iyardref)
fFormMapDraw.MdiParent = [/size][size=2][color=#0000ff]Me[/color][/size][size=2].MdiParent
fFormMapDraw.Show()
[/size][size=2][color=#0000ff]End If
End Sub
[/color][/size]
If anyone could help me with where im going wrong i would really appreciate it.
Thanks
Carl