By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

Close all child forms

P: n/a
Hi all,

I just have a small vb6 upgraded to dot net and now I'm fixing the problem
according to the upgrade report. Most of them are easily fixed except one
I'm not quite sure ...

I have a MDI form, in vb6 when I close it I have the following code :

Dim Frm As Form

For Each Frm In Forms
Unload Frm
Next

Now it has problem :
'UPGRADE_ISSUE: Forms collection was not upgraded. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2068"'

For Each Frm
Frm.Close()
Next Frm

Can someone guide me how to fix it? I don't have .net experience so your
help is very appreciated~ Thanks~

K.K.
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
KK,

Probably you don't have to unload them, so try first what happens when you
delete that phrase.

If you really need to close them, by instance to start new in the middle of
your program, than you can in your MDI container Form use the collection
mdiChildren.

http://msdn.microsoft.com/library/de...classtopic.asp

However be aware that this is than not as easy as it looks, because a "form"
has to be IsDisposed (don't mix this up with calling dispose) when you
create them new again.

I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
Kay
Thanks Cor, I'll just remove the code and see how it works, thanks for ur
link too~

K.K.
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
KK,

Probably you don't have to unload them, so try first what happens when you
delete that phrase.

If you really need to close them, by instance to start new in the middle
of your program, than you can in your MDI container Form use the
collection mdiChildren.

http://msdn.microsoft.com/library/de...classtopic.asp

However be aware that this is than not as easy as it looks, because a
"form" has to be IsDisposed (don't mix this up with calling dispose) when
you create them new again.

I hope this helps,

Cor

Nov 21 '05 #3

P: n/a
"K.K." <kk@micxsoft.com> schrieb:
'UPGRADE_ISSUE: Forms collection was not upgraded. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2068"'

For Each Frm
Frm.Close()
Next Frm


The 'Forms' collection as known from VB6 has gone:

Reclaim the Lost VB6 Forms Collection
<URL:http://www.fawcette.com/vsm/2002_12/online/hottips/lobel/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.