473,385 Members | 1,562 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,385 software developers and data experts.

Close all child forms

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
3 3823
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: clu82 | last post by:
I have an MDI app that allows the user to open multiple client address child forms. The user has a child form open that has client id "1001" and the records associated data displayed. If the user...
2
by: Guy Babbitt | last post by:
I have an MDI application that starts an instance of a child form at application start. I have an event handler on a combo box checking for the selected value to change. When the select value...
1
by: Martin Douglas | last post by:
Hey guys, maybe someone can help me with some MDI issues I have. A co-worker asked me a very simple question, one that I blew off as trivial, and it has become a time-consuming issue. Simply...
0
by: Bruce | last post by:
I have an MDI parent form frmMain that *should* allow multiple instances of a child form frmChild. The frmChild operates completely independently of frmMain (aside from being an MDI child), and...
7
by: Alice | last post by:
Hi, In my program, the user can navigate to many different forms. When they go to the next form, I want the form they have left to close. However, the forms aren't closing. Can anyone tell me...
0
by: Tom | last post by:
Let's say I have an MDI parent that has 5 open child windows in it. Now let's say that I have a function in the MDI parent that attempts to close all the child windows. It's starts running, closing...
0
by: Bill | last post by:
Hi I have a parent child forms. I want the close, maximize, and minimize buttons to be removed. One the child form I have set the maximize and minimize buttons to false. I have the child form...
4
by: LCAdeveloper | last post by:
Help! Another newbie question I'm afraid. I have a toolbar on an MDI form, which I can control OK to produce a child form. When the child form is active, the appropriate MDI parent form toolbar...
0
by: bmwm3 | last post by:
Hi: New to C#, I have a MainForm (parent) that can potentially have multiple child forms (in a tabbed interface). Mainform has closing event defined for "Close All" (through a menu option)...
3
by: =?Utf-8?B?RGF2ZVA=?= | last post by:
I've got a situation in a VB 2003 Windows application with an MDI form and a child form. In certain situations, when the child is closed by the user, I also want to close the MDI parent. Is there...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.