hi
i have function in mdiparent form and i want to use it in child form.
i created an object reference of parent form in child form and tried to call the function but this didnt worked.
wat should i do??
plastic
0
Newbie Poster
Recommended Answers
Jump to PostFirst of all, C# doesnt have functions, they are methods. I'm on a crusade to eradicate that word from this board ;)
Secondly, how is the method declared, private/public/protected? How have you created your reference to the parent form?
Jump to PostTheres your problem. You arent getting a reference to your original Form1, you are creating a new one.
You need to get a reference to the original form if you want to effect any changes to it:Form1 parent = (Form1)this.MdiParent; parent.alllblvis();
You need to ensure you …
All 5 Replies
Geekitygeek
480
Nearly a Posting Virtuoso
plastic
0
Newbie Poster
Geekitygeek
480
Nearly a Posting Virtuoso
plastic
0
Newbie Poster
DdoubleD
315
Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.