|
-
Oct 30th, 2010, 12:42 PM
#1
[RESOLVED] Where to setup dialog forms from
Hi Guys,
Just a little question that doesn't really matter that much but I'm just curious how everyone else does this.
The question is essentially: Where do you setup your dialog forms from? Do you set properties and populate items from the form that calls the dialog form or do you do it in the dialog form's Load event?
Lets say for example I have a main form and a dialog form that lets the user add/remove some strings from a listbox that the main form then uses (and therefore the current items in the listbox should be remembered next time the dialog is shown). Would you populate the listbox with the existing strings from the main form and then show the dialog window, or would you pass the strings in to a property of the dialog window and then let that window put them into the listbox when it loads?
I realise its not the best example because you could avoid having to do either if you just didnt dispose the dialog window, but there are numerous situations in my programs where I need to setup items on a dialog window (and dispose it when it has closed) and I currently tend to do it all from the form that is showing the dialog window. This often means I end up with a ton of code in my 'main' form if it calls several dialog windows though so it just got me wondering if other people tend to let the dialog windows do all the work themselves.
How do you guys handle this?
Cheers
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|