Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created September 21, 2016 16:50
Show Gist options
  • Save jskeet/dce5d4fdba80281eaf4365ce7ed8d80a to your computer and use it in GitHub Desktop.
Save jskeet/dce5d4fdba80281eaf4365ce7ed8d80a to your computer and use it in GitHub Desktop.
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