Open identical new form

sorsater

New member
Joined
Feb 26, 2012
Messages
3
Programming Experience
1-3
Hi guys!

I have a problem.
I want to open a form that is identical to the previous one, like a new process but I have no clue on how i can do.

Like if you doubleclicked the same icon to the program again but instead click a button in the program.
I've tried to search on google and here but couldn't find anything.

Hope you understand my question and my english.
Thanks!
 
What I would do is when you click the button in your program, write the needed info to get the next instance to show the same info that the current app has open then have it open a new instance of itself but pass it in a commandline arg so it knows to read that file. Then make your program check for the commandline arg and read the file, open the forms and all that.

Though I'm curious to why you're looking to do such a thing in the first place.
 
Are you trying to actually transfer data entered by the user in the first instance to the second, or are you just saying that you want to run the same application a second time?
 
But I don't know which code I need to open a new instance.
You don't need to write the whole code, just hint me in how I will do and then I think I will make it.

Together with a friend I'm making a program for poker.
You have a table where you fill in statistics from the game and we wan't to open a new table if you multitable.
Like in File--> Add table

Thanks!
 
It would be nice if we really new what you wanted to do. You talk about starting a new process but it sounds like you just want to open a new form in the same process. I asked a question and you didn't answer it. Please provide a FULL and CLEAR explanation of the problem.
 
To start a new process in VB.NET you call Process.Start. To execute a file you pass the path of that file to Process.Start. The file path of the current executable can be found in a WinForms application using Application.ExecutablePath. So, you now know how to get the current EXE file path and you know how to execute a file by path. That's all you need.
 
I would create a MainForm with a notifyIcon and a contextmenu attached to that so you could simply rightclick the icon in tray and add new Instance or something, where you in your code would add to Button_Click Event:

Dim NewForm as New Form2
NewForm.Show()

where Form2 is the form you want a new instance of. in your case, your Poker table form. :)

Gunze
 
Back
Top