|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Deleting all forms in collectionform properties and such. Baseform is, as can be expected, the basis for the other forms in my project. I want to close all forms whenever the x is clicked on any of those forms, so I go to the closing event and cycle through the forms collection, closing each of them down like so. either Forms(n).Close or Systems.Windows.Forms(n).Close or something similar. But to my surprise, I don't get the count property as an option to get n number of forms, and manually putting in a number doesn't offer close as a valid method either. My guess was that, since baseform inherits from form, so baseform would be part of the forms collection as a result. I can work around it by putting in a method that checks and closes each form by name, but I'd have thought looping through the collection via index numbers would be a simpler solution. I have the feeling that I'm missing something obvious here. Can someone help? Thanks. -- Cheers, ymt. Hello,
Cant we use dim f1 as form For each f1 in system.windows.forms if f1.isopen is true f1.close next ??? Try it out. Sorry if i dint catch your point. Show quoteHide quote "Yuk Tang" <jim.lak***@yahoo.com> wrote in message news:Xns974BD3A7E7E0Ajimlaker2yahoocom@130.133.1.4... >I have created my own custom forms called baseform, inheriting normal > form properties and such. Baseform is, as can be expected, the basis > for the other forms in my project. I want to close all forms > whenever the x is clicked on any of those forms, so I go to the > closing event and cycle through the forms collection, closing each of > them down like so. > > either > > Forms(n).Close > > or > > Systems.Windows.Forms(n).Close > > or something similar. But to my surprise, I don't get the count > property as an option to get n number of forms, and manually putting > in a number doesn't offer close as a valid method either. My guess > was that, since baseform inherits from form, so baseform would be > part of the forms collection as a result. > > I can work around it by putting in a method that checks and closes > each form by name, but I'd have thought looping through the > collection via index numbers would be a simpler solution. > > I have the feeling that I'm missing something obvious here. Can > someone help? Thanks. > > > -- > Cheers, ymt.
How to Exit an application properly on Error
Regional settings cause runtime crash How would I make this into a class ? simple program HELP. Tabbed MDI Interface [VB.NET express 2005] - Regular expressions Sharing source code between Vs2003 and Vs2005 IDE After Select.......not really? How to send an Email in VB.NET Namespace not available... next / next x difference |
|||||||||||||||||||||||