Click here to Skip to main content
16,020,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i made a control in Test1 Project

and i also made a form in Test2 project .

Test1 Project and Test2 Project are in one common project

and i want to call form(Test2 Project) in control(Test1 Project) so how

can i call it in Control
Posted

I assume you mean:
"I have a solution, with two projects, Test1 (which contains a control) and Test2 (which contains a form). How do I display the form from Test in the control in Test1?"

Because if they are both in the same project then you can just write
FormInTest2 frm = new FormInTest2();
frm.Show();


1) Add a reference to Test2 in Test1 (In solution explorer, right click "References" and select "Add Reference" - follow the dialogs from there)
2) At the top of the Test1 code file add the line
using Test2;

3) Add the code:
FormInTest2 frm = new FormInTest2();
frm.Show();
 
Share this answer
 
Bt dear the control is in components.and ur ans is not work .
 
Share this answer
 
Comments
OriginalGriff 7-Jul-10 7:41am    
I'm soory but that makes no sense - please try to explain more clearly!
in simple ur code is not work.
 
Share this answer
 
Comments
OriginalGriff 7-Jul-10 11:40am    
Couple of things:
1) Don't just add an answer to your own question: I don't get a notification that you have more info / questions. Edit your existing question to give more information, and / or add a comment to my answer. That way, I get an email.
2) "ur code is not work." is not exactly helpful. I am not psychic; I cannot see your screen, or read your mind. Tell us what happened / didn't happen. What errors you got, if any. Post a fragment of the code you tried (using the "code block" widget by editing your question) so we can tell what you are doing. Basically, give us as much relevant information as you can. Don't post you whole program, and don't expect us to download it and try it that way - most of us are far too wary about viruses for that!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900