formclosing

  • Thread starter Thread starter Pascal
  • Start date Start date
P

Pascal

Hello

What are the steps to close properly (being sure that nothing keeps in
memory) forms opened as vbmodal even if man uses the "red cross" at the top
right form ?

thanks

http://www.scalpa.info
 
Pascal said:
What are the steps to close properly (being sure that nothing keeps in
memory) forms opened as vbmodal even if man uses the "red cross" at the
top right form ?

Are you sure your question targets VB.NET/VB 2005? In VB.NET/VB 2005 there
is no 'vbModal' as in VB6. For VB6-related questions consider posting to an
appropriate group in the "microsoft.public.vb.*" hierarchy.
 
oops I wanted to say as "ShowDialog()" instead of "vbmodal".....
Frm_myst.ShowDialog()

sorry...

http://www.scalpa.info
Are you sure your question targets VB.NET/VB 2005? In VB.NET/VB 2005
there is no 'vbModal' as in VB6. For VB6-related questions consider
posting to an appropriate group in the "microsoft.public.vb.*" hierarchy.

You just need to make sure you dispose of the form when you're done
with it, I usually use a "Using" block to do this:

Dim Frm_myst as new MyForm();
Using (Frm_myst)
Frm_myst.ShowDialog()
' Do something else with the form
End Using

Thanks,

Seth Rowe
 
hello
It works but is this correct ?
Private Sub LeNombremystèreToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
LeNombremystèreToolStripMenuItem.Click

Me.Hide()

Dim Frm_myst As New Frm_myst()

Using (Frm_myst)

Frm_myst.ShowDialog()

End Using

End Sub

thank you
pascal

You just need to make sure you dispose of the form when you're done
with it, I usually use a "Using" block to do this:

Dim Frm_myst as new MyForm();
Using (Frm_myst)
Frm_myst.ShowDialog()
' Do something else with the form
End Using

Thanks,

Seth Rowe
 
hello
It works but is this correct ?
Private Sub LeNombremystèreToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
LeNombremystèreToolStripMenuItem.Click

Me.Hide()

Dim Frm_myst As New Frm_myst()

Using (Frm_myst)

Frm_myst.ShowDialog()

End Using

End Sub

thank you
pascal

You just need to make sure you dispose of the form when you're done
with it, I usually use a "Using" block to do this:

Dim Frm_myst as new MyForm();
Using (Frm_myst)
Frm_myst.ShowDialog()
' Do something else with the form
End Using

Thanks,

Seth Rowe

If all you want to do is show Frm_myst then it should be fine. However
I notice you are calling Me.Hide() and never reshowing it - is this
intentional?

Thanks,

Seth Rowe
 
hello Seth Rowe
I notice you are calling Me.Hide() and never reshowing it - is this
intentional?
in fact i have a main_form from which i call other forms like frm_myst (
where pupils have to guess a mysterious numbers by giving numbers and the
frm_myst responds too high or too small) when they want to have another
exercise they close the frm_myst and they return to frm_main.
i put this
Private Sub Frm_myst_FormClosed(ByVal sender As Object, ByVal e As
System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed

Me.Dispose()

Frm_main_mdi.Show()

End Sub

Private Sub Fermer()

iTargetNumber = 0

iTargetNumberDecim = 0

iGuessCount = 0

nbreDePartie = 1

TxtBxProposition.Text = ""

Label1.Text = ""

Label2.Text = ""

message = ""

GrpBxReglage.Enabled = True

Btn_Genere.Enabled = True

Me.Close()

End Sub


Thanks,
pascal
 
Back
Top