|
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
If you can't read my code, try converting it here[^]
|
|
|
|
|
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
|
|
|
|
|
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
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi, Raddevus,
As someone who has spent far too much time wrestling with the quirks of the MS supplied WinForm Controls ... many of which are .NET wrappers around old COM.ActiveX Controls ... I have a less "rosy" view of them: imho, they are a herd of cats
From the "cup is half-full" perspective, you could say that MS enabled a market for 3rd. party control developers to create much more powerful and internally consistent controls, with consistent API's. I remember, so well, my elation when I discovered Andrej Stojkov's Lidor TreeView Control: felt like I had gotten out of jail
I was excited, initially, by WPF's promise of an all-vector rendering engine, bubbling event-model, superior binding facility, etc. And, of course, symbiosis with a web-stack, SilverLight.
There was some great work done here, on CP, by pioneers like Clifton, Adrian Alexander, O'Hanlon, Josh Smith, Sacha Barber, and others.
The reality of programming in Visual Studio with WPF, however, just was not right ... for me.
Then, came the debacle of Metro, the deprecation of SilverLight, the failure of Metro, MS VP Sinofsky's (Metro honcho) departure, the WinRT hoop-la, etc. A lot of devs felt burned; fence-sitters, like me, decided to stick with WinForms.
If only ... one can waste time fantasizing about ... WinForms had a retained-mode all-vector, 2d graphic engine, and WPF's event and binding facilities. A Designer.cs file-format that at least was more XML-like, or, even XAML like.
A few comments:
1. For WinForms TreeView and ListView that would be the 'HideSelection Property.
2. There is a more recent (2016) 2nd. ed. version of Nathan's book for Windows 10: [^], but it's listed as unavailable on Amazon, currently.
«While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)
modified 13-Dec-17 21:42pm.
|
|
|
|
|
Really like your summary of the situation because that is my experience too.
I've been using those old controls since Win3.1 -- okay Win95 --- okay I guess they get updated once in a while but it seems like those are the same controls we've been working with since Win95 and you're right there is plenty about them that is bad / crufty / cracked.
But, since we've been working with them for 20 years we know how to get around those things.
I remember about the time Vista released I started messing around with WPF / XAML and wasn't that impressed seemed like a bunch of stuff to learn to draw my own controls when I could more easily drop a windows treeview on a WinForm app and be done. I'm no graphic artist so I let the TreeView be a TreeView.
Then the Silverlight debacle and all the rest just as you said.
Now Microsoft does the head-fake to UWP. I start learning XAML again and it is pretty cool.
But then you go to look for these things that must surely be easy even in XAML since people have been doing WPF / XAML, right? But you can't find the answers? It's all just crazy.
EDIT
Also, it is very interesting that the author changed that book's name to Building Windows 10 Apps from the previous name of Universal Windows Apps.
Makes me feel like Microsoft whispered in his ear something like,
"Uh, we're backing off the whole UWP/UWA thing, so..." ugh!
|
|
|
|
|
Just my $.02:
WinForms are really easy. And I mean, REALLY easy, I've enjoyed using them for years.
The click for me, when going to WPF, is: 4K monitors. If your resolution is high-res (such as, for 4K), WinForms are taking a really big fall. About close to 2 years ago, I got a laptop with 4K resolution. At this point, things starting to go downfall. What you see in the VS designer, is not what you will see visually. Some of the controls you create will look incredibly messy. The AutoScaleMode : if you go with Font , it will look horrible. If you go with Dpi , sometimes it's decent, sometimes not - what I've found is that most of the time, as long as I keep the form/control under 1900x1080, it's ok; and as a side-note, never go with None .
Now, add to that the Anchor property - which I used heavily to properly align controls. It seldom works on high resolution monitors.
What you end up is pretty much "try to see if it works". And "if" it works, you need to then test at other resolutions. So, long story short, as monitors get higher and higher res, WinForms is losing ground.
Now, onto WPF - really steep learning curve, but the results can be amazing. A lot of things will once again be "trial and error" at first, but once you get the hang of it, and if you have some pretty fancy UI in mind, WPF can definitely help you there. That, and Resharper
Best,
John
-- Phot-Awe - Find the Photos you Love - FAST!
|
|
|
|
|
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.
|
|
|
|
|
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!
|
|
|
|
|
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.
|
|
|
|
|
As I get older all my skill declines..
For example after reading your message a few times I fail to see your point.. is it a question? (about what?) a statement? (for whom?)...
Glad you play with XAML anyway. XAML is great!
Other than that WPF is great! Ever heard of Visual Studio? It's a WPF application ya know!
But not many people write desktop application these days, that's why WPF is kind of neglected...
|
|
|
|
|
|
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.
|
|
|
|
|
Quote: 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. I work in WinForms with a team that requires ease of maintenance over innovation. Being a 20+ yr. programmer, I have learned that getting deeper into whatever you are using generates more functionality than any shiny new tech you learn from scratch. That doesn't mean that a better way of building things is ignored, just that you learn to sift value gained vs effort spent.
|
|
|
|
|
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
|
|
|
|
|
I have used WPF outside on my personal projects and as has been said before WPF makes the simple complicated and the complicated simple.
My experience is that it's a bit like doing web development - it can be a real PITA but when done right gives you something nice to look at... and that's pretty much what it comes down to - you can create 'nice' custom controls and it encourages loose coupling of the data and the UI.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: WPF makes the simple complicated and the complicated simple
That's a perfect explanation of the situation.
That's a perfect quote for everything Microsoft is doing now, it seems.
|
|
|
|
|
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
|
|
|
|
|
GuyThiebaut wrote: the only reason they introduce new frameworks into the business is to improve their cv.
Yep. That nails it.
|
|
|
|
|
raddevus wrote: 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 I'm not well versed in UWA matters but in WPF using a behavior would be one route you could take. Maybe not exactly what you're trying to achieve, but when working on a SignalR-WPF chat application I needed new items added to an ItemsControl to scroll into view, which is not the default behavior of the ItemsControl . I wrote a behavior to achieve this, which you can look at here: SignalChat: WPF & SignalR Chat Application.
"As beings of finite lifespan, our contributions to the sum of human knowledge is one of the greatest endeavors we can undertake and one of the defining characteristics of humanity itself"
|
|
|
|
|
That's a very nice article and a nice explanation of that behavior.
I will look at that more closely.
I was wondering if it would be a behavior which I find interesting since it feels like this simple thing takes a bit more processing power -- observing an event, instead of the thing just getting set and forgetting about it.
Thanks very much.
|
|
|
|
|
We started to work with WPF and MVVM years ago and I am very astonished that people still use WinForms. WPF/MVVM really does everything we need (for our standard product for company users). And I never found it difficult to get other developers' advice and examples for WPF.
We also have some UPW apps in the store, but I cannot find companies working with them.
Btw, I understood, that UWP is based on .Net Core and therefore will survive, when the Win32 kernel will die.
|
|
|
|
|
raddevus wrote: Just thought it was very interesting. How about you?
I'd rather deal with the quirks of HTML than WPF, which I won't tell you what it reminds me of every time I try to use it. Think Alabama voters and why they don't vote Democratic (usually.)
|
|
|
|
|
Is that an analogy for inbred?
|
|
|
|
|
Nish Nishant wrote: Is that an analogy for inbred?
No, more of a single voter issue analogy.
|
|
|
|
|
Ah, okay. I over thought it
|
|
|
|
|