0

I am trying to make a program that will run on a system. The program will launch a driver on startup, which displays a cmd window. I am trying to get my program to come back to the front after it opens this. I have tried using a few different things such as:

Me.BringToFront
Me.Activate
Me.Show

However, none of these have worked so far, does anyone know of another way I can do this?

MCSGaming
  • 3
  • 4
  • 1
    `Me.TopMost = True` then `Me.Activate()` then `Me.TopMost = False`. – Reza Aghaei Feb 04 '20 at 17:18
  • 1
    There are a bunch of solutions [here](https://stackoverflow.com/q/5282588/3110834). – Reza Aghaei Feb 04 '20 at 17:20
  • Thanks @RezaAghaei, this is exactly what I needed. – MCSGaming Feb 04 '20 at 17:32
  • 1
    If you mean to *obscure* the cmd Window, maybe you can just *hide* it (run the Process without a Window, if possible, and/or use `[Process].StartInfo.WindowStyle = ProcessWindowStyle.Hidden`) – Jimi Feb 04 '20 at 17:36
  • @Jimi Thanks for this, this works brilliantly. – MCSGaming Feb 04 '20 at 17:40
  • Does this answer your question? [What is the "right" way to bring a Windows Forms Application to the foreground?](https://stackoverflow.com/questions/1463417/what-is-the-right-way-to-bring-a-windows-forms-application-to-the-foreground) – HackSlash Aug 22 '22 at 18:49

0 Answers0