Creating GUI launch application in C#

  • C/++/#
  • Thread starter Iron_Brute
  • Start date
  • #1
19
0
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.
 

Answers and Replies

  • #2
DavidSnider
Gold Member
488
131
On the event handler for the button put:

Process.start("yourExe.exe");
 
  • #3
15
0
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:
<Button Content="Click me!" Click="DoStuff" />
Code-behind example:
Code:
private void DoStuff(object sender, RoutedEventArgs e) {
  Process.Start("SomeProgram.exe");
}
Don't forget to include the System.Diagnostics using!
 

Related Threads on Creating GUI launch application in C#

  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
4
Views
3K
  • Last Post
Replies
9
Views
23K
Replies
3
Views
11K
  • Last Post
Replies
8
Views
3K
Replies
9
Views
2K
Replies
11
Views
10K
Replies
6
Views
3K
Replies
9
Views
4K
Top