I have run into a problem where I am receiving an error message when I have 10 - 12 child forms open (the error message actually points to a usercontrol causing the problem, but I have exhausted my testing on the control and have not stumbled on a problem with the control). Most of the time my users will not have this many windows open, but I would like to know if there is a limit so I can account for that fact.
Originally posted by rhdeleon I have an application that uses an MDI form.
I have run into a problem where I am receiving an error message when I have 10 - 12 child forms open (the error message actually points to a usercontrol causing the problem, but I have exhausted my testing on the control and have not stumbled on a problem with the control). Most of the time my users will not have this many windows open, but I would like to know if there is a limit so I can account for that fact.
Any help is appreciated.
R De Leon
AS far As I know there is no limit for how many child forms to be open.
Was the error "Out of Memory" (7 - I think) ?
If it is then you have found the limit of MDI forms you can have. The limit is based on the amount of memory available to your machine. Some simple forms can be opened hundreds of times, more complicated forms can only be opened a few times.
My advice is put code in to catch the "Out of Memory" error and pop up a message along the lines of "There are not enough resources to display this window - please close any unused windows and try again."
'Buzby'
Visual Basic Developer "I'm moving to Theory. Everything works there."
The user control is a modified combo box that does a few simple tasks such as displaying a different icon based on the combo value to alert the user for various reasons.
I did more testing and came to a similar conclusion that I am using up all the available memory and since most of the controls are user controls, the error message is thrown up regarding the user control, rather than out of memory.
I retract my previous statement and now think it is a limit based on the number of controls or something other than available memory.
In this same application I have several other forms.
One form has only 1 custom control and 27 other controls. I was able to open it 31 times before receiving an error that stated that a control could not be set. Task Manager told me that I had plenty of memory available, so it wasn't a memory problem.