views:

341

answers:

4

I wrote a console program in c# that takes up to three files as input, and does some data calculations on them.

I'd like to make a simple frontend that allows the user to easily

*import files - basically choose up to three files to be routed to the backend code

*change settings - i have about 10 settings that i'm currently storing in an app.config file. maybe a simple settings box would be nice

*see whats going on - the console program shows some status messages that might be useful to display on a GUI

I have practically no experience with windows forms or gui design, so I really dont know where to begin. i compiled the backend stuff into a *.dll and am currently playing around in design mode of sharpdevelop...but i really have no idea how to get the two to work together.

any pointers would be greatly appreciated!

+3  A: 

The usual pattern, in cases like these, is to make the main features of the application into a class library and call that from a wrapping executable, such as a console app, winforms app or webforms app (if possible). That way you can easily adapt the interface as needed and simply route input and output to and from the class library.

Edit: I realize this isn't a very indepth answer, but I hope it helps to get started at least, together with any other answer that may arrive.

J. Steen
A: 

Have you tried Visual Studio Express editions? They're free and come with a designer for either WinForms or WPF applications.

As a first pass you'll need 3 text areas for the filenames, with associated buttons to bring up the file open dialog (it doesn't actually open the file just returns the filename).

A label to display the status - updated from your worker code.

Then either the various radio buttons, check boxes etc for your configuration settings.

Oh and don't forget the "Start" button to set off your process.

If your process takes a while you ought to use a background worker thread. You can then implement a "Cancel" button to safely abort the process and tidy up if it goes wrong.

There will be optimisations and reorganisations that you can do once you've got it working.

ChrisF
A: 

Your question is quite indistinct. If you're asking about working with GUI, you should read some book on Windows Forms. And if you're asking about how to put your dll in your new windows forms application, then you should just add a reference to it in winforms project's properties and then use classes from dll's namespace.

Dmitry Lobanov
+1  A: 

If you want to get started with GUI design in .NET, I recommend you choose WPF (Windows Presentation Foundation). This is the latest technology released in the UI/graphics area by Microsoft and is where everything is heading now. (Windows Forms won't be obsolete for a long time, though it is surely but slowly becoming deprecated.) I noticed however that you are using SharpDevelop, which doesn't yet have real support for WPF (as far as I know), whereas it certainly does for WinForms. If there's any chance you can use Visual Studio, I recommend you begin by learning WPF. You have the advantage of not being confused by previous experience with the styles and methodologies of WinForms, so it would very much be the right way to go.

Whichever you wish to learn, the Getting Started page of WindowsClient.NET (the official MS site for both WinForms and WPF) would be a great resource. There's also a few MSDN articles on getting started with WPF.

Hope that helps.

Noldorin