Results 1 to 4 of 4

Thread: How to Pass Data Between Two MDI Forms

  1. #1
    Join Date
    May 2008
    Posts
    222

    How to Pass Data Between Two MDI Forms

    I have a main form as MDI parent and MDI child form, the child form shows a new form (I called it mydialog). I add a simple TLabel somewhere on that form, then i create a new child form from that window:
    Application->Createform, and on this form, I include a simple Tbutton. I want to create a toolbar button on MDI form when user clicks it, it will get string from Active child form executing function GetStr.

  2. #2
    Join Date
    Dec 2008
    Posts
    128

    Re: How to Pass Data Between Two MDI Forms

    There should be no exception when setting the Owner property. To share data among the child MDI forms, create a public property in MDI parent/container form and access that property through out all your child form. Can you paste the exception ? Also could you paste your code that sets this value ? Have you set other properties like MDIParent / etc ? When you create your MDIChild, at the moment you are getting the overall executable to create this form for you (because you are using the Application->Createform).

  3. #3
    Join Date
    Oct 2008
    Posts
    180

    Re: How to Pass Data Between Two MDI Forms

    You should be able to access the properties and methods of the MDIChild form. To get an instance of an opened from, you can use this... Dim f2 As Form2 = CType(Application.OpenForms("Form2"), Form2), By including MDIParent.h in MDIChild.h, you should be able to access the properties and methods of the MDIParent form. If you look at the end of any of the auto-generated headers for any forms.

  4. #4
    Join Date
    Feb 2006
    Posts
    167

    Re: How to Pass Data Between Two MDI Forms

    I created an MDI application that opens two "child" forms when it loads. These child forms have a label and a button on them. When the button is clicked on one child form(Form2), it changes the text of the label on the other child form(Form3). I prefer to pass in any custom data or parameters to the Form by its constructor. It is the least "WinForms"-specific way and in fact is no different to constructing mostly any other object really.

Similar Threads

  1. Replies: 9
    Last Post: 30-08-2010, 04:57 PM
  2. How to Pass data from one page to another in PHP?
    By Aldous in forum Software Development
    Replies: 3
    Last Post: 25-09-2009, 03:21 PM
  3. How to pass MVC data from attribute to controller
    By Saaarc in forum Software Development
    Replies: 3
    Last Post: 14-07-2009, 10:14 AM
  4. Forms In C#.net
    By sagngh88 in forum Software Development
    Replies: 1
    Last Post: 19-05-2009, 08:09 AM
  5. Replies: 4
    Last Post: 25-02-2009, 07:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,059,333.29809 seconds with 17 queries