Yes i want to share the forms between the projects. Like this
If i press a button in form1 in project1. i want that the frmAdd in project2 will appear and vice versa. if i press a button in any forms in project2 some forms will appear in project1. something like that. how im gonna do that ?
Things doesn't work like that, the only way to reference a Form in another Project would be using an Active-X DLL, you can't reference Forms between 2 Standard EXE Projects. An App (EXE) can be created with many VB Projects and that is a Project Group, but if you want inter-comunications between the Project members, one of them must be the Standard EXE Project, and the rest of them should be Active-X DLL Projects compiled and referenced by the first.
Why don't you add the Forms you need in the Main Project? you can create a copy of the Form or add the Form directly from the Path it is in the other Project, but beware that in this case, both Project would work with the same file, if you change code in that Form/Module in one of these Projects, if will affect the other.
And there is still a chance you're saying "Project" when you might be talking about share data between 2 Applications, that would be different.
The reason why i want to do that iter-connection in two different projects. Because we are group into 3, and we are making different projects. So i want that i have a links of my system and i want that if i click one of that links the 2 projects that was made of my groupmates will open. So how im gonna use the Active-X DLL ?
So i want that i have a links of my system and i want that if i click one of that links the 2 projects that was made of my groupmates will open.
The projects will open? or the applications will open? if you really want to open a Project maybe you could try using ShellExecute API to open them with VB6 .
if i click the button in form1, i want that the frmAdd in project2 will open. Same as if i click the button in form2, the frmDel will open, and so on. something like that
If you are a group of people working together on a project, and each of you is doing a couple of forms for this project, they should ALL be part of a single project. That way they are easily connected, and for the workshare you need to specify who is working on which files (i.e. forms). All of you however should use the same project!
However if you are working on different projects (your Project1 doesn't need the forms of Project2 and vice versa), you need to make that kind of connection.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button Wait, I'm too old to hurry!
However if you are working on different projects (your Project1 doesn't need the forms of Project2 and vice versa), you need to make that kind of connection.
@opus = so how im gonna do that inter-connections. Base on jcis suggestion i need to use a active-x dll or shellexecute ? But if you read my post #7 what is the best solution ?
if i click the button in form1, i want that the frmAdd in project2 will open. Same as if i click the button in form2, the frmDel will open, and so on. something like that
Could you explain the Clicking part little more.
Are you saying that in your project 1's Form1 has button , and when your RUN project 1 and press that button , the frmAdd in Project1 should open in the VB IDE?
Or Are you saying, WITHOUT RUNNING project 1, when you click that Button frmAdd Should be open?
the project 2 have also 4 forms but dont have any buttons.
Project 2:
frmAdd
frmDel
frmEdt
frmClr
now what im trying to do is if i click the button in form1 (in project1) i want that the frmAdd in project 2 will open. Same with if i click the button in form2 (also in project1) i want that the frmDel in project2 will open and so on. Hope you get my point
Still couldnt understand the part you say as CLICK.
does it mean when you run project1 one and click the button
or without running the project click the button in design mode?
Last edited by zeezee; Aug 27th, 2007 at 08:20 AM.
Reason: Typo
If you need that at run time (compiled mode) then you'd have to make your Project2 as ActiveX DD and then set references to that dll in your Project1.
Then you'd create an instance of whatever class and one of its methods should have a procedure that will load a form beased on its name or whatever.
If you need that at run time (compiled mode) then you'd have to make your Project2 as ActiveX DD and then set references to that dll in your Project1.
Then you'd create an instance of whatever class and one of its methods should have a procedure that will load a form beased on its name or whatever.
Thats bit hard for me to explain, I think Rhino will give you some explanation better than this.
What you should do is, Make your project2 an ActiveX project.
Then in your project1 , you make a refernce to that project. simply making a variable of that.
In your project 2 , you should have a pulic method and a puplic class.
In public method like this
Code:
public sub ShowForm(Formname as String)
Forms.add formname
end sub
you call that method in your Project1, passing the relevant formname
like that. This may be not the CORRECT way. Please someone clarify this more.
Last edited by zeezee; Aug 27th, 2007 at 08:42 AM.
Reason: typos :)
For more explanation. Here it is. Look at Project1 pic.
1. For now dont look on project2 pic. If i have a single project which is project1 you will see there i have 4 forms and a button. If you run it if you want to go to form2 or form3 or form1 etc. You can use this code
Code:
form1.show
unload me
'or
form3.show
unload me
'or
form4.show
unload me
You can do that because all forms are in a single project.
2. Now look on my project2 pic. i also have 4 forms but it only have labels and textboxes. Now both project1 and project2 are now running. Lets say my home page here is the project one. SO imagine that in front of you your just seeing buttons. If you click the "Show Form1" the frmAdd of project2 will now prompting nor will now display and so on.
Oh before i give a rate on this and mark it resolved . How did you put the project2 in the project1 (its bit confusing). Can you give me the steps. I get the idea but the placing of projects dont know how
- Create new project (standard exe)
- Go to File >> Add Project (you will have to select type of project from the list)
- If you select ActiveX.dll then after you add it
- go back to main project and add references (Project > References) to that new dll project
- use code similar to that I gave you
Oh before i give a rate on this and mark it resolved . How did you put the project2 in the project1 (its bit confusing). Can you give me the steps. I get the idea but the placing of projects dont know how