Multiple Forms & Me.Close

H

Herwig

Hi all,

I've got an application with multiple forms: Form1, Form2, Form3.
In this application there is also a Module: Module1.

The main window is Form1 which is launched at startup.
In Module1 there is a function which opens and closes Form3:

private Function SomeFunction()
Dim PopupForm As New Form3
PopupForm.Show()
'Do something here and when done:
PopupForm.Close()
PopupForm = Nothing
end Function

As long as I call this Function from Form1 everything is OK.
As soon as I call Form2 from Form1 and call this Function from Form2:
1. Form3 won't close
2. Form3 will only close after Form2 has been closed (I've added a
Button which calls Me.Close(): I'm able to call anything from this
form - except: Me.Close() )

My Problem: I've got an application with several forms from which I
need to call a Function from a separate Module which opens a new form
containing progress information. This form needs to be closed
automatically after the process is done. How can I do this (not only
from my startup-form)?

yours

Herwig
 
S

Serg Kuryata [MS]

Hello Herwig,

The problem that you are seeing is due to a known issue in the .NET Compact
Framework: modeless form cannot be closed when it is shown by modal dialog
until the modal dialog is dismissed. In your case, a workaround would be to
call PopupForm.ShowDialog() instead of PopupForm.Show(). Hope this helps.

Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: (e-mail address removed) (Herwig)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: Multiple Forms & Me.Close
| Date: 2 Apr 2004 00:03:15 -0800
| Organization: http://groups.google.com
| Lines: 32
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 62.2.101.169
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1080893026 13948 127.0.0.1 (2 Apr 2004
08:03:46 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Fri, 2 Apr 2004 08:03:46 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news.glorb.com!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:50138
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi all,
|
| I've got an application with multiple forms: Form1, Form2, Form3.
| In this application there is also a Module: Module1.
|
| The main window is Form1 which is launched at startup.
| In Module1 there is a function which opens and closes Form3:
|
| private Function SomeFunction()
| Dim PopupForm As New Form3
| PopupForm.Show()
| 'Do something here and when done:
| PopupForm.Close()
| PopupForm = Nothing
| end Function
|
| As long as I call this Function from Form1 everything is OK.
| As soon as I call Form2 from Form1 and call this Function from Form2:
| 1. Form3 won't close
| 2. Form3 will only close after Form2 has been closed (I've added a
| Button which calls Me.Close(): I'm able to call anything from this
| form - except: Me.Close() )
|
| My Problem: I've got an application with several forms from which I
| need to call a Function from a separate Module which opens a new form
| containing progress information. This form needs to be closed
| automatically after the process is done. How can I do this (not only
| from my startup-form)?
|
| yours
|
| Herwig
|
 
P

plutoplanet

Thank you,

meanwhile I have changed Form2.ShowDialog() to Form2.Show(). This also
works.
Sorry for bothering everone with a known issue,... VB&.NET&CF is still
something new to me

HH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top