How do I invoke a method in a userform from parent form?

后端 未结 2 1186
醉酒成梦
醉酒成梦 2020-12-07 06:29

Learning C#:

I have structure of

form1 (splitcontainer)
  userformLeft (button + sub-panel)
    userformDisplay (loaded into panel in userformLeft)
         


        
相关标签:
2条回答
  • Similar problems of communicating between one form and another... whether attaching to "events" of one, or calling / setting values to/from each other. Here are a couple links to questions I've answered to in the past that may help understand the relationships to do so.

    Sample 1 with explicit steps to create two forms communicating back/forth to each other

    Sample 2 somewhat similar, but attaching to events between forms

    0 讨论(0)
  • 2020-12-07 06:59

    yes.. you can do this:

    myLong = ((form1)this.parent.parent).mainTimer;
    
    0 讨论(0)
提交回复
热议问题