473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 1281
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Zippy | last post by:
Some months ago, we requested help from this newsgroup on how to replace the library reference of a database with another library reference, prior to creating an MDE. I got the following answer...
4
by: Cybertof | last post by:
Hello, What is the difference between : - adding a new reference to a namespace within the SolutionExplorer (right click, Add Reference...) - adding a new reference with the 'using' keyword in...
12
by: Bill Todd | last post by:
Form B needs to call a public method of Form A. How can form B get a reference to the instance of Form A using its name or any other method? Is there a collection of form instances that can be...
3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
0
by: Patrick | last post by:
This is a C# post. I'm using VB.NET to create an add-in for the Google Sidebar, and have implemented the OnDetailsView method. NOTE : I've come across this same problem (error message) even in...
16
by: Paul S. Natanson | last post by:
What is a Null Reference error and how do I fix it? My newly installed VB.Net2003 gives me a "Microsoft Development Environment" error message box EVERY time I try to run/start ANY project -...
2
by: Jeff | last post by:
I'm getting an Object Reference error before I even run my app, and I'm not sure where to look to find the cause. I'd appreciate your help. When I open my Windows Application project, the...
7
by: gerryLowry::Ability Business Computer Services {KC | last post by:
"Getting Back Your Visual Basic 6.0 Goodies" by Billy Hollis, 2003-5-14, states: "Getting a Forms Collection Visual Basic 6.0 developers are often fond of looping through the currently loaded...
9
by: bill | last post by:
I keep getting Object reference not set to an instance of an object error when trying to run my application on an installed client machine. I installed it on several others and it runs fine. I...
3
by: Sarang | last post by:
Hi, I have this code that makes the form as an MDIChild: chartWindowController.GetForm().MdiParent = _expertTradeMainFrm; chartWindowController.GetForm().WindowState =FormWindowState.Normal;...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.