What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Call a "parent" method.

Call a "parent" method.
Author: Message:
The Brain
Junior Member
**

Avatar

Posts: 49
Reputation: 1
– / Male / Flag
Joined: Jan 2003
RE: Call a "parent" method.
I've never used C#, but this is based on my java knowledge. I can't see it being possible just you've done that. But, if every MyObject object is going to need to call a method in 'its' Form1, why not give your MyObject a reference to its Form1.

code:
public partial class Form1 : Form
    {
        MyObject o;

        public Form1()
        {
            this.o = new MyObject(this);
            //Constructor Body
        }

        public void method()
        {
            //Method Body
        }
    }

class MyObject
    {
        Form1 myform;
        //Constructor, takes Form1 object, assigns to myForm vairable
        myForm.method(); //Not any Form1 but the "parent" Form1 class.
    }


I think that's what you're looking for - let me know if it works for you like you wanted.
03-07-2006 10:30 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Call a "parent" method. - by leito on 03-07-2006 at 05:59 AM
RE: Call a "parent" method. - by The Brain on 03-07-2006 at 10:30 AM
RE: Call a "parent" method. - by RaceProUK on 03-07-2006 at 02:13 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On