Creating GUI launch application in C#

Click For Summary
SUMMARY

This discussion focuses on creating a GUI application in C# that launches executable files. The recommended approach involves using Windows Presentation Foundation (WPF) and XAML for designing the interface, which is compatible with .NET 3.5 and later versions. Key programming techniques include utilizing the Process.Start method to execute .exe files and implementing event handlers for button clicks. Visual Studio is suggested as a development environment that supports drag-and-drop GUI design.

PREREQUISITES
  • Familiarity with C# programming language
  • Understanding of Windows Presentation Foundation (WPF)
  • Knowledge of XAML for GUI design
  • Experience with Visual Studio IDE
NEXT STEPS
  • Explore WPF documentation for advanced GUI features
  • Learn about XAML syntax and best practices
  • Research the System.Diagnostics namespace for process management
  • Practice creating event handlers in C# for user interactions
USEFUL FOR

Beginner to intermediate C# developers, software engineers interested in GUI application development, and anyone looking to enhance their resume with practical programming projects.

Iron_Brute
Messages
19
Reaction score
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.
 
Technology news on Phys.org
On the event handler for the button put:

Process.start("yourExe.exe");
 
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!
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K