Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

.NET dialog communication

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jason.a.malone@gmail.com - 09 Mar 2005 19:32 GMT
I have written an app with a main window and a dialog window.  I would
like to be able to have an event from the dialog window update some
information in the main window.  So, Visual Studio creates two .h files
with two classes for each of the Forms (Main Window and Dialog Window).
The way I have written the application right now is to add an event
handle to the Main Window so that when a button is pressed it opens the
Dialog Window.  This works fine and I am able to pass data from the
Main Window to the Dialog Window with no problem as such:

/* snip from MainWindow.h */
DialogWindow *show_dialog= new DialogWindow();
show_dialog->textBox1->Text = S"new text";
show_dialog->ShowDialog();
/* end snip */

My problem is that I would like to go the other way as well:

/* snip from DialogWindow.h */
MainWindow->textBox1->Text = this->textBox1-Text;
/* end snip */

Obviously this code will not work since DialogWindow knows nothing
about MainWindow.  I have found the Form::Owner method and it looks
close to what I want since I can use it to create a handle in
DialogWindow that points to its owner MainWindow (I still cant
reference textBox1).  I think that I will need a third class that
creates and shows both dialogs.  The problem is that I cant include the
header for my dialogs (They are not just declarations they are also the
class definitions) in my third class while also including the header
file from my third class in my dialogs (I hope that makes sense).

I am hoping that someone can provide some ideas or reference some
example/tutorials that I have not been able to find via Google (I have
become even better friends with google over this issue) or msdn.

I hope I have made myself clear enough for someone to provide some
pointers.  If not I will be happy to clarify as much as I can.

Thanks for any help you can provide.

Jason
jason.a.malone@gmail.com - 10 Mar 2005 14:33 GMT
Can this not be done?  I mean,  it is basically the same thing as a
FileOpenDialog.  I just want to use a custom dialog instead of the
canned one.  The FileOpenDialog can be included in the form (the same
header file)  Is it possible to make a custom dialog into a component
that can be included the same way?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.