Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Creating GUI launch application in C#

  1. Aug 15, 2010 #1
    I wanted to create a GUI that would launch a series of .exe files

    My biggest problem right now is I do not know how to program the buttons to launch the executable files.

    I have done some coding with C# but never any GUI work and not sure how to start.

    I also wanted to see if there was a way to have my GUI able to support Vista and 7, as if it were for industry or something.

    This is for a personal project so that I can add it to my resume.

    If anyone could suggest a starting off point, or anybooks that would be useful for creating a GUI I would really appreciate it.
  2. jcsd
  3. Aug 15, 2010 #2


    User Avatar
    Gold Member

    On the event handler for the button put:

  4. Aug 20, 2010 #3
    As for creating GUIs, have a look into WPF. WPF is supported throughout .NET 3.5 and up (and maybe even earlier, I don't know). XAML is an XML extension which allows you to form the GUI in an XML-ish language.
    Those two technologies make it really easy to build fancy GUIs with little effort. If you've got Visual Studio, it can create GUIs through drag and drop and Expression blend works similarly.

    MSDN is always a good source of such information.

    As for the button handlers, it's easy with XAML! Every button has a Click attribute. Type in a name for the method to run and in the code-behind simply create a private method.

    Example XAML:

    Code (Text):
    <Button Content="Click me!" Click="DoStuff" />
    Code-behind example:
    Code (Text):
    private void DoStuff(object sender, RoutedEventArgs e) {
    Don't forget to include the System.Diagnostics using!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook