473,327 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

formclosing

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
Apr 8 '07 #1
6 3251
"Pascal" <sc*********@wanadoo.rfschrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 8 '07 #2
oops I wanted to say as "ShowDialog()" instead of "vbmodal".....
Frm_myst.ShowDialog()
sorry...
http://www.scalpa.info
"Herfried K. Wagner [MVP]" <hi***************@gmx.ata écrit dans le
message de news: e6**************@TK2MSFTNGP02.phx.gbl...
"Pascal" <sc*********@wanadoo.rfschrieb:
>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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 10 '07 #3
On Apr 10, 4:45 am, "Pascal" <scalpano...@wanadoo.rfwrote:
oops I wanted to say as "ShowDialog()" instead of "vbmodal".....
Frm_myst.ShowDialog()

sorry...

http://www.scalpa.info
"Herfried K. Wagner [MVP]" <hirf-spam-me-h...@gmx.ata écrit dans le
message denews: e6nRE9geHHA.4__BEGIN_MASK_n#9g02mG7!__...__******* ***************@TK2MSFTNGP02.phx.gbl...
"Pascal" <scalpano...@wanadoo.rfschrieb:
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.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
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

Apr 10 '07 #4
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
Apr 11 '07 #5
On Apr 11, 9:04 am, "Pascal" <scalpano...@wanadoo.rfwrote:
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

Apr 11 '07 #6
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

Apr 11 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Frank | last post by:
Hello, in the formClosing event I put an endEdit for the datagridview. Works fine. Except when the cursor is on the line for a new record. That gives errors because some fields are not filled (and...
1
by: e_man_online | last post by:
Hi, I have a VStudio 2003 project that had code like: Private Sub frmAnyForm_Closing(<parameters list...>) Handles MyBase.Closing and this project was converted to .NET 2.0 Everything...
1
by: pamelafluente | last post by:
Hi, I am not clear if there is there any difference in usage between Closing (mybase) and FormClosing ? Any advice on that ? -P
4
by: Academic | last post by:
I read the Help and some of the many Google hits I got but can't find out the difference between MyBase.Closing and MyBase.FormClosing Can anyone tell me? Thanks
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
1
by: V | last post by:
I've got a custom control that uses a timer. Need to make sure that the timer gets shut down when the control exits. Breakpoints set on a destructor for the control do not execute, but I'd like to...
1
by: dani kotlar | last post by:
Is it possible to suspend the closing of a form from the FormClosing event handler, or any other way? Thanks
0
by: Academia | last post by:
I have a Mdi app. In FormClosing, e.CloseReason works OK in the Children. But in the Mdi form it always show UserClosing. Since the children close first I could set a global flag in them...
8
by: AAaron123 | last post by:
If I show a form with ShowDialog and Dispose it FormClosing does not appear to run. At least I think that is true. If I want FormClosing and FormClose to run am I suppose to call the forms...
2
by: Anthony P. | last post by:
Hello Everyone, I'm writing an application that will reside in the system tray once it is configured. The application also has an exit button called, creatively, ExitButton. I'm in a bit of a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.