Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 21st, 2004, 04:53 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default Discussion: Returning from "dialog" forms


We have a windows forms application. In it is FormA. It needs to pop open FormB as a dialog to ask the user for some information. FormB has an "OK" and "Cancel" button. If "OK" is clicked, then FormA should do something. If "Cancel" is clicked, then FormA should do nothing.

[u]Possible Solutions</u>:

1. Show FormB modally such that FormB is displayed and FormA waits for it to close before continuing its code execution. Then FormA looks at a public property on FormB for information about what happened ("OK" or "Cancel") and also looks at a public property for the "return" information.

2. FormA shows FormB and continues. (Presumably the logic to show FormB is in a click handler, and nothing else happens.) Then, when a FormB button is clicked a public event is raised and FormA handles the event and performs the necessary actions respective of the event.

Which makes more sense?
Which follows the .NET model better? (Is #2 more appropriate for the event driven paradigm of .NET?)
Which do you prefer?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save As Dialog in web forms collie ASP.NET 1.0 and 1.1 Basics 0 March 18th, 2008 08:41 AM
c discussion forum giri_nitr C++ Programming 0 April 30th, 2007 05:44 AM
replace Word dialog with my designing dialog doublelucky Visual C++ 0 March 19th, 2007 02:27 AM
ASP Discussion group kosla78 Classic ASP Basics 0 July 3rd, 2003 08:02 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.