Results 1 to 7 of 7

Thread: [2005] communication between 2 childforms

  1. #1

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    [2005] communication between 2 childforms

    Hello everyone...
    I have already done a project in VS2005 using mdiparent form and mdi child forms.
    Now,When I click the button of one child form,Ive made it open an instance of another form as child form under the same mdiparent.

    But,now I want to access the controls of the 1st childform from the 2nd child form.
    How do I do it?
    Ive already seen ...
    http://www.devcity.net/Articles/100/multipleforms2.aspx

    but I do not find help on accessing controls of one mdichild form from another mdi child form when the instance name is not available to the form.
    Please help me with this...
    Thanks a lot,
    Godwin

    Help someone else with what someone helped you!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] communication between 2 childforms

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: [2005] communication between 2 childforms

    Hi Jm,Thanks..
    I have seen the link on your signature.
    Im trying to find to access the other child through the parent if thats the way.Is there some kind of casting that can be done? nevermind if thats on my part to find out..i am trying []
    Thanks
    Godwin

    Help someone else with what someone helped you!

  4. #4

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: [2005] communication between 2 childforms

    found some answer from the article here...i'll go through the source code and come back
    This article has only covered a sample cross-section of some of the ways you can open multiple forms. There are other techniques (MDI, 'Form within a form' and owned forms, for example) that haven't been included here. But hopefully there is enough information here for most purposes in the early days of your journey up that long and tiring .Net learning curve.

    If you do want to see some working code for MDI or owned forms, then you can check out the attached solution. It includes all seven methods above, plus these two.
    Godwin

    Help someone else with what someone helped you!

  5. #5

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: [2005] communication between 2 childforms

    Its not there in his examples on how to control controls between 2 mdi child forms
    Godwin

    Help someone else with what someone helped you!

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] communication between 2 childforms

    What's the difference? Two forms is two forms. One of the forms has to have a reference to the other in order to affect it. The parent is the link so it has to provide the reference, just like the mutual friend I mentioned has to provide the other party's phone number for me to call them. Once you've got that reference then it's just another object and you can treat it as such. Don't think of forms as any different to any other objects because they're not. If you want to affect an object you need a reference to it, plain and simple. If you don't have a reference to that object then it's got to come from some other object that does.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: [2005] communication between 2 childforms

    Hi Jm,
    Really great explaination
    Thanks so much..
    got it :-)
    Godwin

    Help someone else with what someone helped you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width