Denaes Posted April 22, 2004 Posted April 22, 2004 I'm looking to create what a message box does. A form which pops up (should be modal), allows a person to insert text, make selections, choose dates, and those results are returned to the parent form. Example: I want to do a Date Picker calander as a popup window. I want the window to start up with the current date (pased from the form) selected. Red dates will be inapplicable. The user selects dates to add to an array of dates. When the Form is finished, it returns that array as a result. I've needed to do this sort of thing on a few occasions (popup Customer Chooser, which returns the Customer Number for example), but I've always had to cheat to get around it. I've used a public module to hold the information, but that is very annoying, bad practice and you have to pay attention to clearing it out, adding to it, etc. What is the proper way to do this? Quote
*Experts* mutant Posted April 22, 2004 *Experts* Posted April 22, 2004 You can do it the way all modal dialogs in .NET do it. Set up properties and private variables that will be retunred through the properties, when the dialog is closed you will be able to access the properties of the form because unlike normal forms, modal forms are not disposed when the Close method is used on them. Quote
*Experts* Bucky Posted April 22, 2004 *Experts* Posted April 22, 2004 If you wanted, you could also make the input controls Public and then access their values directly from the parent form after the modal form closes. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Malfunction Posted April 23, 2004 Posted April 23, 2004 But this is rather dirty ;) Quote Debug me...
Arch4ngel Posted April 23, 2004 Posted April 23, 2004 I agree ! Teacher's always told us... at least if you want to access a variable (or anything)... do it in a property ! (they were crying each time used direct variable :P) If your teacher is killing himself to make you understand... be patient until he die. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.