tags:

views:

1206

answers:

10

Hello all
I'm a C++/Java developer and have no idea about .net or GUIs. I need to develop a windows app for 2000/XP/Vista/7.

I think I've come to conclusion that C# is the best and the fastest way to go (please correct me if I'm wrong). What do you recommend? Which GUI approach should I learn? (Forms? Any other stuff?)

Is it the best way to compile in .net 2.0 mode? It's going to be an application for the public to download.

A: 

C# WinForms will be the fastest in terms of getting a practical GUI working rapidly. Though if you think on making a complex GUI, with animations, 3D etc, WPF would be better.

You can use CodePlex to find some good working projects to learn from in terms of best practice, both for WinForms and WPF.

You can also look here for some good books on both WPF and WinForms.

Am
+2  A: 

You could use Windows Forms or Windows Presentation Foundation to develop your GUI; although, Windows Forms might feel more familiar to you. If you search on Google for Windows Forms tutorial, you will get many options for getting started.

If you need to use .NET 2.0, you will be limited to Win Forms. WPF requires .NET 3.5.

I would suggest downloading Microsoft's free Visual Studio Express Edition to use for developemnt. it includes an excellent drag-and-drop GUI design tool.

Adam Crossland
Technically, WPF only requires .Net 3.0.
codekaizen
Shouldn't the 2008 express edition provide access to 2.0, 3.0 and 3.5?
Chris
Yes Chris, but he may need to develop the program for clients which don't have a recent version of .net
Daniel S
+8  A: 

For desktop applications there are basically two options; WinForms and Windows Presentation Foundation (WPF).

WinForms is more traditionally built and hence easier to learn. WinForms might therefore be a simpler start, but if you plan on actually using your gained knowledge in GUI development for .NET I'd say you're better of diving into WPF from the start. It's a much richer framework, and where Microsoft is putting their effort for desktop applications. It is also similar to Silverlight, meaning you can easily get into Silverlight too when you know WPF.

Good luck!

stiank81
Could whoever gave me -1 make a comment about what they disagree on such that we can all learn from this?
stiank81
@bambuska - "WinForms is more traditionally built and hence easier to learn"It's not, generally. It only is if you come from an event driven GUI background.
codekaizen
Thanks for commenting. You're right about this, but compared to WPF I still think this is valid. Many other GUI options are event driven and hence comparable to WinForms (Java Swing, Delphi, Qt, ..), while WPF is different from most other options.
stiank81
A: 

I think I've come to conclusion that C# is the best and the fastest way to go (please correct me if I'm wrong). What do you recommend?

Personally, I would stick with Java. We (meaning OffByZero, the company I co-founded) have released an encrypted text editor called OBZVault, which is written in Java.

We originally wrote it in Linux, and then ported to Mac OS X and Windows. We found that the Windows port provided a perfectly acceptable look & feel - almost (but not exactly) like a native Windows app.

We used InnoSetup to build a native Windows installer, and found that quite good as well.

Bottom line: unless you want to learn a new language & platform, or you have a specific need for functionality provided by a different platform like .NET, stick with Java for your Windows development too. You'll need to learn a Java GUI framework, but then you'd have to learn WPF or WinForms if you switched to .NET anyway.

It may be faster for an experienced .NET developer to build a Windows app in WinForms or WPF, but if you're already well versed in Java I say stick with the tools (language, libraries, IDE) that you know.

Duncan Bayne
This does not answer the question and looks too much like an ad of your company.
yu_sha
Bottom line: You didn't understand his question and want to sell him your app?
Jan
Duncan Bayne
Nah, c'mon, you're advocating Java for GUI development... seriously, that's just not right.
Dmitri Nesteruk
Duncan Bayne
A question for those who voted my answer down - was it because I suggested the OP was wrong to pick C# over Java, or because I linked to my own commercial Java app?
Duncan Bayne
this is a reason i hate stackoverflow. you get downvoted for having a legitimate idea or theory that doesnt jive with the mainstream. booo on all you downvoters.
Devtron
+1 from me. even if it is crazy talk.
Devtron
@yu_sha: What question do you think I left unanswered? I thought the OP was wrong about C# being the best I have a valid basis for my opinion that the OP should stick with Java (as I've done a _lot_ of C# dev in both WinForms and WPF as well).
Duncan Bayne
+100 from me just being an Aussie. She'll be right, mate :)
Devtron
+2  A: 

In my personal development experience Windows Forms is just about as easy as it gets when it comes to rapidly deploying a GUI application on Windows. WPF is of course another option, but using it would likely require you spend some time familiarizing yourself with XAML. Windows Forms look and feel like a lot of the available GUI options for Java, it's just much better than the majority of them, in my opinion.

If you want the fastest possible GUI development time in .NET, Windows Forms is it.

Nathan Taylor
I disagree. WPF is faster, especially if coming from a web background.The WPF design story is much nicer as well as having at least as good code access as WinForms.
codekaizen
I disagree with codekaizen. If we're talking speed, WinForms is way faster for someone who hasn't met either. Plus, the visual designers actually work and do not require a separate program (that would be Blend) to use.
Dmitri Nesteruk
Duncan Bayne
@Dmitri - Do you have experience with someone new learning WPF vs. Winforms? I do. WPF is easy for them. It's just hard for you since you have experience with WinForms's traditional approach. Also, you don't need a separate program. What gives you that idea? VS Express works just fine.
codekaizen
My point was made in light of someone coming from Java to .NET for GUI development. WPF is a very powerful (and fairly easy) platform, but the learning curve is likely to be steeper for someone who has never used something like it before. The decent Java GUI tools are all fairly similar to the Windows Forms designer, but I know of none that are like WPF.
Nathan Taylor
@codekaizen, WPF may be faster ONLY if coming from a web background. Absolute positioning as is default in WinForms (ie the button stays exactly where I put it and the same size) is just more obvious than flow layout (why does my button move to the top of the form and change size?).
Ash
The Windows Form designer is a true WYSIWYG editor. There are very few fancy visual effects that can be achieved, but with that limitation comes the confidence that what you create in the designer is exactly what the end user is going to see. If you've got a background in web development then the limitations of Windows Forms may decrease the appeal and draw you more toward WPF, but there is, without a doubt, a great deal more to think about when working with XAML.
Nathan Taylor
A: 

I would recommend learning Winforms first, then move the WPF. Winforms is easier to learn and get something working quickly. The future however is WPF, so I wouldnt leave that in the dark. I posted some good books and links for GUI development work.

Books

  • Design of Everyday Things A really good book about design of interfaces. It's not software specific but a must read for GUI designers.
  • Coding Horror. He recommends a lot of development books on his book list, but these ones are specifically interface-related:

Don't Make Me Think
About Face 3.0
The Inmates Are Running the Asylum
GUI Bloopers

Web Links

SwDevMan81
+1  A: 

I disagree with all the WinForms advocates. It's not easier. It may be easier for someone who has traditional experience with GUI programming, but this poster doesn't have that.

WPF has a better design story and the databinding is much, much better than WinForms. You can get up and running on WPF at least as fast as WinForms, and then go much further without running into the limitations that WinForms has. Couple this with the design-time databinding in VS 2010, and I'd say that anyone starting out on GUI development should completely bypass Winforms.

codekaizen
I would also strongly suggest that start directly with WPF. I maintain a complex winforms app and I wish that we had WPF when started.
Pratik
A: 

C# for sure. Use Winforms for line of business app / classic GUI.

read petzold 'programming windows with c#'

Or just dive in with visual studio. Creating GUI with VS is really easy - you will like it

You will find the langauge transition from java to c# pretty simple (not the gui bit tho)

pm100
A: 

Here's a good start with a basic Hello World example:

Add a button and a label to a form. Double click the button to access the code for the onClick event. Write

label1.Text = "Hello World";

in the onclick event. Run the program, click the button. Hello world in .NET GUI - the most basic example.

reach4thelasers
+1  A: 

Yes. C# is the language of choice when it comes to .NET development. Since you've programmed in Java, you'll find that the language looks very familiar (it looks a bit cleaner though and has some very nice features like delegates and you can even use pointers if you really want to, although you won't need to in most circumstances).

It's SWF (System Windows Forms) or MWF (Managed Windows Forms - a lightweight version of SWF written in managed Code using System.Drawing - it frees you from the WinAPI that's underlying classical SWF) all the way.

There's also GTK-Sharp, a GTK+ binding for C-Sharp, but since you're developing for Windows, users will find it strange to install a third-party GUI framework for your application.

I wouldn't recommend using WPF though. It makes direct calls to the underlying graphics hardware, which means it's quite fast, but not portable at all. It will only run on x86 systems (not SPARC, etc.) with DirectX compliant hardware rendering units (graphics cards) and it will not run on a system with strong hardware abstraction (like most Unices like BSD or Linux or Solaris).

Novell also stated that they will never implement WPF in the near future due to it's strong hardware dependencies (Novell wants Mono to be portable across many processor platforms). Don't use WPF. Software is no longer just a throw-away-product and when it comes to operating systems we're in the age of spin. The platform you're running today isn't necessarily the platform you're gonna run tomorrow. WPF is a proprietary and patent-encumbered technology developed by Microsoft and Intel. If you use it, you'll find yourself in a very nice Win32-on-x86 vendor lock in. And this means that you'll most definitely find yourself completely re-writing your application sooner or later. Just write portable software from the beginning, even if you don't need that portability today. I'm telling you from experience, you will need portability tomorrow. Definitely!

no.human.being
SWF and MWF are not valid terms talking about Windows Forms development on Windows. System.Windows.Forms = WinForms = Managed windows forms. Are you talking about WinForms on Linux using Mono? If so you should clarify in your answer so the OP is not confused.
Ash