-2

How to move from one form in C# to another form in VB.net?

I tried this code:

Process b = new Process();
this.Hide();
System.Diagnostics.Process.Start(@"D:\Fingerprint System\Fingerprint System\bin\Debug\Fingerprint System.exe");
Thread.Sleep(1000);
SendKeys.SendWait("{Enter}");

But it opens the main form in VB.net which is form1, and I want to open another form in VB.net which is form4.

Jim
  • 2,974
  • 2
  • 19
  • 29

1 Answers1

0

Change the startup form in your vb.net project to that of form4 so that when you launch the Fingerprint System.exe the form you desire is the one launched by default.

If the behavior you wanted is more complex than that you could always leverage command line arguments when launching the executable that correspond to a form you would like to be shown.

Tyler Benzing
  • 1,116
  • 11
  • 25
  • but if i try this solution the main page(form1 will not open first) , my idea is to open form1 in vb.net and then move to c# form after that move to form4 in vb.net – درة التقى Dec 09 '16 at 08:08
  • If the behavior you wanted is more complex than that you could always leverage command line arguments when launching the executable that correspond to a form you would like to be shown. Can you explain it more? – درة التقى Dec 09 '16 at 08:20
  • @درةالتقى Basically just have a switch statement at your programs entry point that switches on an argument that corresponds to the form that you want to open. – Tyler Benzing Dec 09 '16 at 18:03