locked
For a new desktop application, WPF or WinForms? RRS feed

  • General discussion

  • If we have a desktop application, WPF or WinForms, which one we should choose? Thx!


    JaneC

    • Changed type Min Zhu Monday, February 13, 2012 2:28 AM
    Wednesday, February 8, 2012 9:50 PM

All replies

  • If this is scratch development, I'd definitely use either WPF or Silverlight.  Windows Forms is basically "dead" technology - it's maintained, but it's no longer improved.  WPF and Silverlight are getting constant improvements, and provide a far simpler upgrade path to WinRT/Metro for Windows 8, as well.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, February 8, 2012 9:56 PM
  • See the following linK: WPF or WinForms, choose wisely

    http://weblogs.asp.net/bsimser/archive/2008/02/25/wpf-or-winforms-choose-wisely.aspx

    Is it better to use WPF over Windows Forms?

    http://stackoverflow.com/questions/640633/is-it-better-to-use-wpf-over-windows-forms

    While WPF seems to be cooler because it does not rely on Win32 as WinForms, there are some performance factors in favor of the latter. Check

    www.codeproject.com/.../RuntimePerformance.aspx


    JaneC


    • Edited by JJChen Wednesday, February 8, 2012 11:08 PM
    Wednesday, February 8, 2012 10:56 PM
  • The first link was from 2008, so I'd question whether it's still relevent at all...  The second supports what I was saying (and it was my answer that was accepted there for a reason ;) )

    As for the warm/cold start time - this is an issue with WPF compared to Windows Forms - but - it also is only measuring the raw framework start times.  WPF has to load Direct3D and setup contexts for it, which tends to make it "base" overhead a bit higher.  However, my experience has shown that for most real-world, larger scale applications, the balance shifts very quickly.

    Part of the problem with WinForms is that every control uses a separate handle.  Larger projects can actually hit the limits of window handles (search the net and you'll find issues here), but that tends to make the load times for larger forms HORRIBLE in Windows Forms.  WPF, on the other hand, tends to use exactly 1 handle per window (for the window itself), as the individual "controls" are all rendered via hardware accelerated DX.

    At the end of the day, though, it really depends on what your application does, and what type of reach/maintainability you want.  I couldn't imagine wanting to start any project not using xaml at this point - the data binding just lets you keep applications so much cleaner than Windows Forms applications (without a lot of effort)...

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, February 8, 2012 11:51 PM
  • Hi JJChen,

    I have changed thread type to General Discussion since this is a open discussion.

    Have a nice day!


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 13, 2012 2:28 AM
  • "I couldn't imagine wanting to start any project not using xaml at this point"

    Yup, that's indeed a really *great* reason to choose technology A over technology B. So good in fact, that I'm going to start preparing my sushi with XAML, it's *so* geeky.

    Tuesday, November 13, 2012 8:37 PM
  • "I couldn't imagine wanting to start any project not using xaml at this point"

    Yup, that's indeed a really *great* reason to choose technology A over technology B. So good in fact, that I'm going to start preparing my sushi with XAML, it's *so* geeky.

    If you read the rest of that statement in my original post - you'll see I said exactly why I believe that, and I still stand by it.  It has nothing to do with it being geeky - it's about the ease in which you can keep your application architecture cleaner and simpler due to the data binding support xaml provides.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, November 13, 2012 8:40 PM
  • I haven't tried it yet.  This is good info, thanks!


    Steve

    Monday, November 19, 2012 3:48 PM
  • Reed is correct, WPF is only way to go.  But then again we've always rejected Javascript and HTML in the past only to have it come back to haunt us.  The bottom line for me personally is why go back to something that is 15 years old.  Stay current and you'll pick up new technology that improves the user and developer experience.

    There is one thing I've noticed about WPF, as MSFT said when they envisioned this separation of GUI from Logic: "We see the future as two camps, GUI Developers and Programmers."  WPF in my opinion takes longer to get where you want it to be; however, it has many great improvements over Forms.  Sometimes I find myself hanging out on the XAML side a lot more than I'd like to.  But the greatest thing about WPF is that when you finish the application the user experience is 100%.  I find that User Experience is extremely important and was overlooked in the old days.


    JP Cowboy Coders Unite!

    Monday, November 19, 2012 5:47 PM
  • FIRST, Clients First. They don't mind if the tomatoes they buy at the grocery came from a 4 wheels truck or a 16 wheels one. What the clients want? Will they find nice to reach part of the application trough their intelligent telephones? If not, and if the network is reliable, you can even consider using Excel or Access if you already know these. Excel if easy to customize for and BY each user; Access is fast to develop traditionnal database(but limited to beige-looking application).

    WinForms and WPF are only User Interface. If there is no logic, if it is just like a web page with few custom plugs-in, your app can maybe use some tool which require no code, but otherwise, you need to know either C# either Vb  in addition to the UI. And while WPF is more recent, it is also a two-head hydras, where "stuff" can be define into one head or into the other. That means that we need extra annotations to make the two heads (C# and XAML) understand each other. And that is not as simple and as transparent as it is for, say, WCF (which is a multi-heads hydra, but not a User Interface), but may have heavy inter-influence (mainly with data binding). Since you ask the question, it is probably because you are NOT already an expert in WPF. So,

    SECOND, you. How much time you have?  Sure, any expertise in using Visual Studio tools can save you hundred hours of writing not so sound code after all, but who take time to check what are all the available tools when in a hurry?  So, go for what technology you will have enough time to do the job (because you know it, or that someone near you owns strong experience and have time to share with you), and spent the extra time you will get in learning about the new tools... that you will use in the NEXT NEXT application. You don't want and don't need to re-invent the wheel, after all. And WPF is a labyrinth, if you are left alone with it... good luck if you are under some pressure to find, alone, the mst agreable exit.

    Tuesday, November 20, 2012 12:54 AM
  • Not so sure about a DESKTOP application (which probably required database support) that WPF is the ONLY way to go. After all, if there is so many changes months after months, is it not because it is far from delivering what is expected by the initial specs? Furthermore, much more things can go wrong at RUNTIME with WPF that with, say, a COM based application. And no need to consider "outside of Windows family" client, for a desktop app, no?

    In don't consider that a dynamically generated web page "is" an "application" and so, I fail to see two "camps", after all, since an application is much more that just a User Interface and always need declarative code like C# or Vb.

    As for the implementation as it is, if I compare WCF with WPF, both "projects" being complex, the integration is much better with WCF than with WPF (even if WCF is not about a user interface). With WPF, there is just too much lack of authority, of "who is in charge" between C# and XAML overlappings, to be effectively two disjoint "camps". On the other hand, WCFand C# integration presents an almost perfect desirable cliveage plane. C# and XAML are far, far from that ideal, in WPF.

    Tuesday, November 20, 2012 1:19 AM
  • When we first ask this question, we want to know the trend of development choice.

    Our team luck enough to implement both WinForms and WPF in our productions.

    No doubt there is a WPF learning curve. Mostly developers in our team prefer use WPF to WinForms after overcoming the WPF learning curve. In general, developers feel that WPF is more powerful. However, using WPF seems more expensive than using WinForms to develop an application. Recently, I just finish reading an article “Super Productivity: Using WPF and Silverlight’s Automatic Layout Features in Business Applications” by Markus Egger (in Code-Magazine)

    http://www.code-magazine.com/Article.aspx?quickid=1011071
    I highly recommend this article. This article actually changes my think a little bit about WPF. I see more power and more flexible of WPF capabilities and how you could reduce develpment time by using WPF.



    JaneC








    • Edited by JJChen Sunday, December 9, 2012 6:22 AM
    Sunday, December 9, 2012 6:17 AM
  • Sir, i want to create a small desktop application like ERP school management and i developed code using wpf and sql ce as back end to store student details now my problem is when i'm running this application in another systems they are not working(Force closing).

    i think database is the problem for application.

    is there any fix to it? or My code is wrong? or

    suggest me any programming language and database which doesn't require applications(like back-end software ) to install in client system.

    Wednesday, September 11, 2013 2:42 PM
  • Silverlight has been abandoned by Microsoft.  Why would you suggest anyone start a new project with it?
    Monday, May 19, 2014 6:31 PM
  • Have you check the system does not run your application?

    They may miss NET framework or  sql CE dlls.


    JaneC

    Wednesday, May 21, 2014 6:55 PM