471,315 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,315 software developers and data experts.

reference forms

I'm gonne try to explain my problem here

I have a classe named Save_open_forms.

I want to call this clas from the mainform (an mdiparrentform).
this is working fine.

now on the class(Save_open_forms) i want to determine witch form is open and
what the name of the form is.
i know how to do this on the parentform itselve, but i can't do this from
the class becouse i can't add a reference to the form.
When i try that i get an error the the reference must be from the type of
dll.

is there a way to do this?

Dec 4 '05 #1
1 1203
Maarten,

In .NET 2.0, you can add a reference to an EXE and use the types that
are in that. However, this won't work for you, because unless you loaded
your child form dynamically...

What you can do is define an abstract class in another assembly, one
which derives from Form that exposes the methods you want to call. Then, in
your EXE, you can derive your form from that class.

Your assembly with the child form then references the other assembly
with the abstract class. You then can get the parent form easily, and cast
to your abstract class.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43**********************@news.skynet.be...
I'm gonne try to explain my problem here

I have a classe named Save_open_forms.

I want to call this clas from the mainform (an mdiparrentform).
this is working fine.

now on the class(Save_open_forms) i want to determine witch form is open
and
what the name of the form is.
i know how to do this on the parentform itselve, but i can't do this from
the class becouse i can't add a reference to the form.
When i try that i get an error the the reference must be from the type of
dll.

is there a way to do this?

Dec 4 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Zippy | last post: by
12 posts views Thread by Bill Todd | last post: by
3 posts views Thread by Poewood | last post: by
16 posts views Thread by Paul S. Natanson | last post: by
7 posts views Thread by gerryLowry::Ability Business Computer Services {KC | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.