Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Desktop: WinForms, WPF, UWA

Desktop: WinForms, WPF, UWA

Scheduled Pinned Locked Moved The Lounge
csharpwpflearningwinformscom
62 Posts 28 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C ClockMeister

    Eddy Vluggen wrote:

    I build tools for people that work. They don't care about flashy, they care about reliability and predictability. I'm not paid for animated borders, but functionality - and will probably still be maintaining WinForms code by the time that our great overloads predicted that AI will write code.

    Absolutely agree. I’ve played with some of the newer GUI technologies myself and keep finding that the mature WinForms technology is the way to go. It might not be considered “flashy” but sure is reliable and gets the job DONE.

    If you think hiring a professional is expensive, wait until you hire an amateur! - Red Adair

    A Offline
    A Offline
    Alan Burkhart
    wrote on last edited by
    #42

    ClockMeister wrote:

    ...is reliable and gets the job DONE

    And in the end, that's what keeps developers in business. I only write apps for my own use and occasionally a CP article. But everything is Winforms. As the old saying goes, "it just works."

    Sometimes the true reward for completing a task is not the money, but instead the satisfaction of a job well done. But it's usually the money.

    C 1 Reply Last reply
    0
    • A Alan Burkhart

      ClockMeister wrote:

      ...is reliable and gets the job DONE

      And in the end, that's what keeps developers in business. I only write apps for my own use and occasionally a CP article. But everything is Winforms. As the old saying goes, "it just works."

      Sometimes the true reward for completing a task is not the money, but instead the satisfaction of a job well done. But it's usually the money.

      C Offline
      C Offline
      ClockMeister
      wrote on last edited by
      #43

      The thing about it is that WinForms applications aren't ugly, the data presentation can be very attractive and meaningful. In my case I've found that having a GUI so well worked out lets me focus on the problem-at-hand instead of spending all my time struggling to get the GUI working right. I have a web-based version of program I wrote for WinForms, it's fun to hack on from time-to-time but just getting the output right consumes a lot more time. I am certainly not against web-based presentation if needed, however if a WinForms application can do the job, the performance is far better and results very consistent. As for WPF (or any of the other cute technologies for desktop GUI) ... it's "hand waving" as far as I'm concerned.

      If you think hiring a professional is expensive, wait until you hire an amateur! - Red Adair

      1 Reply Last reply
      0
      • D Dan Neely

        The big problem with winforms apps we did at my old job was that the native controls all played badly with DPI scaling; a situation made much worse if you had any custom layout code/custom paint code that had an implicit assumption of no scaling in its math and got totally hosed up if you bumped the scaling levels. Dunno if MS has made the situation better in Win8/10 than it was in 7 or otherwise in common libraries over the last 2 years or so. It never got past the list of things we were floating to our govt customer as potential upgrades/an internal pain point for anyone using scaling normally. My new job has WPFed for any desktop apps we do for DPI scaling among other reasons; needing to support older versions of windows means that UWP is a non-starter.

        Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #44

        WinForms works well with different scalings; the options for docking and anchoring make that rather easy. I'd daresay it scales as it should, instead of the modern zoom that most people nowadays apply. It is a well documented library, that many developers are proficient in (making maintenance cheaper), and one that is recognized instantly by many users :)

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        D 1 Reply Last reply
        0
        • L Lost User

          WinForms works well with different scalings; the options for docking and anchoring make that rather easy. I'd daresay it scales as it should, instead of the modern zoom that most people nowadays apply. It is a well documented library, that many developers are proficient in (making maintenance cheaper), and one that is recognized instantly by many users :)

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          D Offline
          D Offline
          Dan Neely
          wrote on last edited by
          #45

          Scale by zooming is the only usable method on 200-300 DPI laptop displays; and if you don't want your half blind but too proud managers to set their 1080p/1440p monitors to 1280x1024 and then complain that all your graphics and text look all stretched out of shape and weird you need to support DPI scaling on normal desktop displays. These options look much sharper if you're able to draw at high DPI directly instead of at 100% and having it stretched by the OS.

          Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

          L 1 Reply Last reply
          0
          • R raddevus

            GuyThiebaut wrote:

            WPF makes the simple complicated and the complicated simple

            :thumbsup: That's a perfect explanation of the situation. That's a perfect quote for everything Microsoft is doing now, it seems.

            G Offline
            G Offline
            GuyThiebaut
            wrote on last edited by
            #46

            Come to think of it... I think you have a good point :) What I describe does indeed pervade most of what Microsoft does and in fact most of IT nowadays. What I see happening where I work is that the young-uns actually admit that the only reason they introduce new frameworks into the business is to improve their cv.

            “That which can be asserted without evidence, can be dismissed without evidence.”

            ― Christopher Hitchens

            R 1 Reply Last reply
            0
            • R raddevus

              Recently, I had an interesting discussion with another CPer who took umbrage with my recent article which summarized a shift from WinForms directly to UWA/UWP XAML and ignored WPF XAML. I mentioned that WPF was indeed ignored by vast numbers of devs and that no shop I've worked in ever paid it more than scant attention. I also mentioned that many devs seemed to (perhaps improperly) connect WPF with Silverlight and MS killed Silverlight in the quiet of the night and many devs never felt much motivation to go to WPF. Not Reviving A Debate Or Anything Against WPF-minded CPer Of course, WPF is used all around, I'm sure. This post is not an attempt to revive a debate that ended up being a very good discussion. I think the CPer was definitely correct on many things he said. My point is the following (and I think it is interesting): Trying To Find XAML Control Solutions: Difficult Today, I was looking for a way to make sure my UWA (XAML-based) app's ListView would show the last selected item even when it lost focus -- keep it highlighted. Could Only Find WinForms Answers As I searched I could find nothing but WinForms answers about how to do that. Those answers are like 7 years old. Should Be Very Simple and Is In WinForms The answer should be very simple. WinForms Answer : In WinForms the answer is set the HideSelected property to false. This is something that is an obvious functionality in a ListView. So obvious that WinForms provided a property. Not so in XAML. Hmmm... Disclaimer Yes, I am a newbie to XAML and someone will surely post the answer to how to do this in XAML as soon as I post. Feels Like Microsoft Never Fully Developed XAML Either This kind of thing makes me feel like Microsoft never carried out the XAML development all the way either. Just thought it was very interesting. How about you? EDIT I also own this book Universal Windows Apps with XAML and C# Unleashed [

              J Offline
              J Offline
              Joe Woodbury
              wrote on last edited by
              #47

              I just wrote two utilities using MFC as dialog apps. The UI work took almost no time, which let me concentrate on the guts of the programs. I debated using WinForms, but it wouldn't have given me the control I needed over the guts, plus everything else in the project is in C++. (I also debated using Qt, but I'm rusty in it and couldn't justify the deployment pains associated with Qt.) I've thought of rewriting the simpler of the two utilities to be a UWP app, on my own time just for learning sake, but it's hard to get the energy for that since my love is still embedded programming in C++.

              R 1 Reply Last reply
              0
              • J Joe Woodbury

                I just wrote two utilities using MFC as dialog apps. The UI work took almost no time, which let me concentrate on the guts of the programs. I debated using WinForms, but it wouldn't have given me the control I needed over the guts, plus everything else in the project is in C++. (I also debated using Qt, but I'm rusty in it and couldn't justify the deployment pains associated with Qt.) I've thought of rewriting the simpler of the two utilities to be a UWP app, on my own time just for learning sake, but it's hard to get the energy for that since my love is still embedded programming in C++.

                R Offline
                R Offline
                raddevus
                wrote on last edited by
                #48

                Great post and it illuminates another topic about this whole UI (WinForms, XAML, etc) thing. For many years, we developers could be completely ignorant about graphic design -- and it was great. We could take the basic controls and drop them on a form and we got this standard look that worked. Sure, there were tweaks we could do but basically there was a nice standard look created by this. We never looked at the designer files -- okay, rarely. We just let windows and controls be windows and controls. Then, with WPF, XAML all of a sudden we have another layer of technology to think about very specifically. It's really all just more work. Sure, people would say you get more control over everything, but it's also more work. And it's work related to graphical elements. We aren't graphic designers or HFE (Human Factors engineers), we are devs!!! :laugh:

                1 Reply Last reply
                0
                • G GuyThiebaut

                  Come to think of it... I think you have a good point :) What I describe does indeed pervade most of what Microsoft does and in fact most of IT nowadays. What I see happening where I work is that the young-uns actually admit that the only reason they introduce new frameworks into the business is to improve their cv.

                  “That which can be asserted without evidence, can be dismissed without evidence.”

                  ― Christopher Hitchens

                  R Offline
                  R Offline
                  raddevus
                  wrote on last edited by
                  #49

                  GuyThiebaut wrote:

                  the only reason they introduce new frameworks into the business is to improve their cv.

                  Yep. That nails it.

                  1 Reply Last reply
                  0
                  • D Dan Neely

                    Scale by zooming is the only usable method on 200-300 DPI laptop displays; and if you don't want your half blind but too proud managers to set their 1080p/1440p monitors to 1280x1024 and then complain that all your graphics and text look all stretched out of shape and weird you need to support DPI scaling on normal desktop displays. These options look much sharper if you're able to draw at high DPI directly instead of at 100% and having it stretched by the OS.

                    Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #50

                    Dan Neely wrote:

                    having it stretched by the OS.

                    It is not stretched by the OS; the developer has to specify which areas can grow and shrink. Depending on whom you are catering to, you'll be switching both DPI and resolution to verify the results.

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                    1 Reply Last reply
                    0
                    • M Mycroft Holmes

                      I'm curious, with the demise of yet another MS technology, the windows phone, what benefit is there to UWP. You have to remember winforms is the most mature windows development platform, I'd be astonished if there are things in there that have not made it into WPF yet. I pray to the great Ghu that those bastards at MS don't deprecate WPF. Yes I'm still bitter about the demise of Silverlight.

                      Never underestimate the power of human stupidity RAH

                      U Offline
                      U Offline
                      User 11319743
                      wrote on last edited by
                      #51

                      Just compare Spider Solitaire Win10 (UWP) and Win7. Specifically, try re-sizing the windows both up and down. Then ask yourself what is UWP good for.

                      1 Reply Last reply
                      0
                      • P Pete OHanlon

                        raddevus wrote:

                        1. Only UWP apps will be admitted to the Windows Store.

                        Ultimately, that's not going to be true. MS has been working to bring the ability to run Win32 apps/WPF apps/Win Forms, etc, to run as appx so they can be downloaded from the app store.

                        This space for rent

                        M Offline
                        M Offline
                        Mike Marynowski
                        wrote on last edited by
                        #52

                        Working on it? It's been out for I don't know how many months.

                        Blog: [Code Index] By Mike Marynowski | Business: Singulink

                        P 1 Reply Last reply
                        0
                        • M Mike Marynowski

                          Working on it? It's been out for I don't know how many months.

                          Blog: [Code Index] By Mike Marynowski | Business: Singulink

                          P Offline
                          P Offline
                          Pete OHanlon
                          wrote on last edited by
                          #53

                          Parts of it yes but there's a lot more surfacing they are working on.

                          This space for rent

                          1 Reply Last reply
                          0
                          • R raddevus

                            abmv wrote:

                            You can create your own controls if you need to..

                            That is good...I know I should feel like that is good. But when you are spoiled by WinForms development and you drag and drop the control and it "Just works" it's difficult to be excited by that. :)

                            abmvA Offline
                            abmvA Offline
                            abmv
                            wrote on last edited by
                            #54

                            Well its up to you..besides there are a number of third party WPF controls available in the market if you don't have the time to do the development esp if you are building a LOB application.

                            Caveat Emptor. "Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long

                            We are in the beginning of a mass extinction. - Greta Thunberg

                            1 Reply Last reply
                            0
                            • R raddevus

                              Great post and info.

                              John Torjo wrote:

                              Now, add to that the Anchor property - which I used heavily to properly align controls. It seldom works on high resolution monitors.

                              I suffered this problem with my winforms when the new higher resolution and wide screens came out.

                              J Offline
                              J Offline
                              John Torjo
                              wrote on last edited by
                              #55

                              Thanks :) One other issue I just remembered - sometimes, when lots (I mean, LOTS) of controls on a dialog/usercontrol, the VS2013 designer crashes a lot of times - so, editing the dialog/usercontrol is a huuge pain. I would have expected this to be solved later on (VS2017), but turns out this is not the case. Best, John

                              -- Phot-Awe - Find the Photos you Love - FAST!

                              R 1 Reply Last reply
                              0
                              • J John Torjo

                                Thanks :) One other issue I just remembered - sometimes, when lots (I mean, LOTS) of controls on a dialog/usercontrol, the VS2013 designer crashes a lot of times - so, editing the dialog/usercontrol is a huuge pain. I would have expected this to be solved later on (VS2017), but turns out this is not the case. Best, John

                                -- Phot-Awe - Find the Photos you Love - FAST!

                                R Offline
                                R Offline
                                raddevus
                                wrote on last edited by
                                #56

                                John Torjo wrote:

                                VS2013 designer crashes a lot of times

                                Yeah, I've run into this problem also in VStudio 2017 and didn't even have a large number of controls.

                                1 Reply Last reply
                                0
                                • C CodeWraith

                                  raddevus wrote:

                                  it is really bad for MVC (the pattern, not the microsoft thing)

                                  Really? Simply use the forms or controls as views and write yourself some nice baseclasses for the controllers (or presenters in my case). To completely get rid of the forms concept, you may also need some concept of a workspace. Easy as pie and I have ported code from ASP .Net web forms (a hack, I must admit) to WinForms, from there to WPF and from there to my own UI in XNA (now MonoGame).

                                  I have lived with several Zen masters - all of them were cats.

                                  A Offline
                                  A Offline
                                  Andre Pereira
                                  wrote on last edited by
                                  #57

                                  Meanwhile, you'll be keeping the CPU busy and draining power, to render 2D surfaces, while your graphics card keeps idling and your users complain of a slow app, nevermind all the frame-skips. Native development is not like web-development, you don't just throw a few libraries and hack a UI.

                                  C 1 Reply Last reply
                                  0
                                  • L Lost User

                                    Feature for feature, WPF has more to offer than Windows Forms; except maybe for the "Open / save", etc. common dialogs. You fail to find an answer to you "obvious" question, and therefor discount the entire platform. Funny thing is, I'm currently looking at a panel which has multiple ListViews with GridViews inside a WrapPanel, and ALL the ListViews are showing the "items that lost focus" as having a "different hilite" than the ones that were not selected. Looking at other implementations, they ALL show the item that "lost focus". And I did "nothing" to activate that functionality. Maybe that's why there are no "articles". Default behaviour out-of-the-box (if you don't override it; like one of the "system colors").

                                    "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

                                    A Offline
                                    A Offline
                                    Andre Pereira
                                    wrote on last edited by
                                    #58

                                    Yeah, a lot of developers forget the wonderful experience that is writing a and then everything just works with no edge cases, allowing you to expand on the complex stuff. That's how you get shit done.

                                    1 Reply Last reply
                                    0
                                    • A Andre Pereira

                                      Meanwhile, you'll be keeping the CPU busy and draining power, to render 2D surfaces, while your graphics card keeps idling and your users complain of a slow app, nevermind all the frame-skips. Native development is not like web-development, you don't just throw a few libraries and hack a UI.

                                      C Offline
                                      C Offline
                                      CodeWraith
                                      wrote on last edited by
                                      #59

                                      André Pereira wrote:

                                      Meanwhile, you'll be keeping the CPU busy and draining power, to render 2D surfaces, while your graphics card keeps idling and your users complain of a slow app,

                                      You don't say! If I only had known that. Fortunately I do use the graphics hardware to render the UI and that multithreded little monster uses a 3D engine to render into the background. The CPU barely breaks some sweat. I have posted the link before: Take a look here.[^] And if you don't like my models or UI design, then that's ok. It simply means that I'm not much of an artist or designer. :-)

                                      André Pereira wrote:

                                      Native development is not like web-development, you don't just throw a few libraries and hack a UI.

                                      Thank god, otherwise our poor CPU would be tied up running some worthless interpreter (like JavaScript) and there will not be enough left for the 2D surfaces. :-)

                                      I have lived with several Zen masters - all of them were cats.

                                      A 1 Reply Last reply
                                      0
                                      • C CodeWraith

                                        André Pereira wrote:

                                        Meanwhile, you'll be keeping the CPU busy and draining power, to render 2D surfaces, while your graphics card keeps idling and your users complain of a slow app,

                                        You don't say! If I only had known that. Fortunately I do use the graphics hardware to render the UI and that multithreded little monster uses a 3D engine to render into the background. The CPU barely breaks some sweat. I have posted the link before: Take a look here.[^] And if you don't like my models or UI design, then that's ok. It simply means that I'm not much of an artist or designer. :-)

                                        André Pereira wrote:

                                        Native development is not like web-development, you don't just throw a few libraries and hack a UI.

                                        Thank god, otherwise our poor CPU would be tied up running some worthless interpreter (like JavaScript) and there will not be enough left for the 2D surfaces. :-)

                                        I have lived with several Zen masters - all of them were cats.

                                        A Offline
                                        A Offline
                                        Andre Pereira
                                        wrote on last edited by
                                        #60

                                        Just as long as your users aren't on Windows XP or Window 7 on "classic theme", which disables 2D acceleration :p. Spread the good word. Don't let web-developers take over what used to be the top-tier experience in usability. [RANT]God, just last week I had to hack some UI stuff on Android with a web-view. Spent 10 minutes developing the required stuff and 3 days debugging web-browser related stuff. And in the end, I still had to mask the page loading in the background, so it doesn't look awful (i.e. like a browser).[/RANT]

                                        1 Reply Last reply
                                        0
                                        • J jonmbutler

                                          Mycroft Holmes wrote:

                                          what benefit is there to UWP

                                          The "U" in UWP to me says it all: Universal. One codebase that runs on desktops, mobile (or at least used to :laugh: ), tablets, Xbox, SurfaceHub, HoloLens, and IoT devices. That may not be attractive to all developers or for all use cases, but from my admittedly narrow understanding it opens up some pretty slick possibilities without the effort it takes to get other approaches working on multiple platforms. Full disclosure: I'm not a developer but I am a Microsoft employee. Flame on. ;P

                                          A Offline
                                          A Offline
                                          Andre Pereira
                                          wrote on last edited by
                                          #61

                                          My non-canned response would be: 1 - It's the most recent and the most supported target for software development. (HiDPI screens, touch and pen, GPS and sensors with a simple native API). 2 - You don't immediately lock yourself out of target platforms, you get some choice. (Desktop is good enough, throw in tablet support for free and everything else is a nice extra.) 3 - Integrated store deployment and store updates (I still remember maintaining the self-updater on a legacy software, something that's obsolete now.). 99 - C# + .net + Xaml + MVVM = development bliss.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups