What form call me ?, if i have many of them....

I create 10 forms dinamically.... << dim f as new frmAny , f.show >>, well, any of these forms calls other form, here i create a value that i need return to the form who call these other form......

How i know who make(which of all the forms) that call to the other form...because only he must receive the value....

Thanks for everything.....




Answer this question

What form call me ?, if i have many of them....

  • amvsoft

    Hans,

    When you show your dynamic forms specifiy the Parent form:

    In frmMain...

        Dim fr As new frmAny
        fr.Show(Me)
       -or-
        fr.ShowDialog(Me)

    Note: Parent parameter is new in .NET 2.0 for Show method

    Then in your dynamic form, you can identify the calling form by referencing:

        Me.Parent

    Does that help

     


  • CyberOps

    You should be aware that when you pass a form to Show or ShowDialog you are passing an Owner, which has consequences. An owned form behaves in a very specific way that is undesirable in most circumstances. It doesn't matter for a modal dialogue because that overrides the behaviour but if you call Show(Me) then you are creating a modeless dialogue.
  • Nayan Patel

    Thanks jmcilhinney, for your note,, I'll take it, for carry me not surprises....

    See you



  • KennyT

    Ohhh thanks Gordon Bell .... I'm going to test this code, and I think it will work fine...

    I Start in this difficult road, the programming... :-)

    See you

    PD. I need an english course...urgently...



  • What form call me ?, if i have many of them....