C# Creating GUI launch application in C#

AI Thread Summary
Creating a GUI to launch executable files can be achieved using C# and WPF, which is supported in .NET 3.5 and later. To start, utilize Visual Studio for its drag-and-drop features to design the interface. XAML is recommended for defining the GUI layout, allowing easy integration of event handlers for buttons. For launching executables, use the Process.Start method within the button's click event handler. Resources like MSDN provide valuable information for beginners. This approach ensures compatibility with Windows Vista and 7, making it suitable for personal projects aimed at enhancing a resume.
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!
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top