Created
September 21, 2016 16:50
-
-
Save jskeet/dce5d4fdba80281eaf4365ce7ed8d80a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Windows.Forms; | |
namespace ConsoleExRun | |
{ | |
class Program | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
var button = new Button { Text = "Click" }; | |
var form = new Form | |
{ | |
Controls = { button } | |
}; | |
button.Click += delegate { | |
Process proc = new Process(); | |
proc.StartInfo.UseShellExecute = false; | |
proc.StartInfo.FileName = "ConsolePrinter.exe"; | |
proc.Start(); | |
}; | |
Application.Run(form); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment