how can I call other project form when I run my start project?

T

Tony Dong

Hi There

I have two vb.net window projects made by vb.net, when I run one project and
click a button in this project window form, how can I call other project
window form ?

Thanks

Tony
 
H

Herfried K. Wagner [MVP]

* "Tony Dong said:
I have two vb.net window projects made by vb.net, when I run one project and
click a button in this project window form, how can I call other project
window form ?

That's not possible. You may want to put the forms into a class library
and reference this library from your Windows Forms project.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
S

Sahil Malik

You can do this, as long as you put your second project forms in a .dll
instead of a .exe (class library for example).
OR you could use reflection to load an exe.

Here's sample code.

Dim dude As [Assembly]
dude = System.Reflection.Assembly.LoadFile("C:\Documents and
Settings\smalik\My Documents\Visual Studio
Projects\Solution1\WindowsApplication2\bin\WindowsApplication2.exe")
Dim frm2 As System.Windows.Forms.Form =
dude.CreateInstance("WindowsApplication2.Form1")
frm2.Show()

Thats it.

- Sahil Malik
Independent Consultant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top