5 ms·
Very excited to see WinForms and WPF especially hit open source. WinForms is still IMHO the hands-down most convenient way to quickly assemble a GUI for an app,
by ocdtrekkie 8y ago
Very excited to see WinForms and WPF especially hit open source. WinForms is still IMHO the hands-down most convenient way to quickly assemble a GUI for an app, and while Microsoft hasn't given it much love over the years, it's huge userbase will hopefully take advantage of the ability to iterate on it via GitHub.
- jack_pp 8y agoI'm not entirely sure we're referring to the same WinForms but I distinctly remember loving C# in 2009 or so, just when WPF was coming out. But I refused to use WPF for my apps because back then you'd have to force the user to install the latest .net which I thought was too much of a bother. So I tried using the old GUI framework and boy was it a nightmare to customize anything. I remember having to override the default Button class and add like 50 lines of code just so I could get a custom background. This and the fact that C# back then couldn't do high scalability servers were what forced me to learn C++ and in my opinion QT is a much easier library to use than the old WinForms was.
- ocdtrekkie 8y agoWinForms' key is the quick drag and drop and edit properties type designer. It's not really intended for you to restyle it entirely (though you can). In that it was 'the style' of apps of the day, you could simply put whatever elements you needed on a form, and then double click on them to put some code behind them. Since WinForms' existing styling was the style of applications of the day, there was little reason to heavily restyle it. Honestly, if someone ran with the new open source WinForms and introduced a Windows 10 style that I could build with the same incredibly easy editor as the existing WinForms, I'd be set.
- blattimwind 8y ago> I remember having to override the default Button class and add like 50 lines of code just so I could get a custom background. That's mostly because you're not supposed to be doing that sort of thing in the first place. Customizing widgets = inconsistent look and feel. Custom widgets = Inconsistent LAF, inconsistent interaction, no accessibility etc. The idea of Win32 UI, WinForms etc. is that you have a look and feel dictated by the system, not by individual app developers, with the ultimate goal being not just a consistent look and feel of the whole system (including applications) but consistently applied patterns of interaction. This in turn makes computers easier to use. Of course, modern UI frameworks, whether in the browser (JS) or outside the browser (QML, UWP, JS, ...) run completely counter to that.
- jack_pp 8y agoThat's all well and good but in certain niches you need custom graphics. A good example is gaming, have you seen how beautiful the blizzard client is? Steam is nice too. Users of these apps don't care about a unified experience with the rest of the win32 ecosystem, in some ways these apps are a different ecosystem unto themselves. I was trying to write a poker client so same thing, using normal buttons just wouldn't have made any sense. It would've been ugly as hell. Modern UIs stray from a standard because standards are boring and if your app is boring then your not so boring competitor will snatch your users.
- jen20 8y agoYour “boring” is a blind persons “basically usable”. Standards exist for a reason. I actively judge apps with non-platform-standard UIs as worse than an equivalent with a standard UI.
- CuriouslyC 8y agoWhile I appreciate inclusivity, software isn't just utilitarian, it's also aesthetic. when it comes to aesthetics, slavish adherence to the lowest common denominator is a cancer... By analogy, would you like it if all books were written for a fourth grade reading level because some people can't handle more complexity? Or if the plots of all movies and television shows were simple enough for an idiot to follow?
- mrsteveman1 8y ago> But I refused to use WPF for my apps because back then you'd have to force the user to install the latest .net which I thought was too much of a bother. That always puzzled me, even though I've seen some of Microsoft's reasoning and blog posts about it. Microsoft has repeatedly stressed that you can't assume any particular version of Windows comes with a specific version of .NET preinstalled (or VC++ runtime, for that matter). Windows already bundles various things, and the major .NET frameworks seem like the thing to bundle and preinstall, and they actually do[0], just not consistently or universally. And, Windows Update can already update the .NET frameworks, in fact I recall that some new major .NET versions were treated as "recommended" installs by WU in the past and were automatically installed on systems that didn't already have them, but they aren't doing that consistently and universally either. [0] https://blogs.msdn.microsoft.com/astebner/2007/03/14/mailbag-what-version-of-the-net-framework-is-included-in-what-version-of-the-os/ https://blogs.msdn.microsoft.com/astebner/2007/03/14/mailbag...
- pandalicious 8y agoI think that’s one of the reasons that WPF never saw much use in terms of widely distributed desktop apps. You couldn’t assume the presence of a particular version of the framework on any given Windows install and (until now) you couldn’t bundle the framework with the app like you could with the JDK.
- ocdtrekkie 8y agoA lot of Windows applications built with .NET do a dependency check and launch the .NET Framework installer (often included in the installation package) if you are missing the minimum required version. Of course, that is a system-level change, which can potentially break other applications on your machine (if they're written badly and/or poorly supported). .NET Core removes that by supporting side-by-side versions and versions packaged with the app, but it certainly wasn't critical to assume a given machine already had a .NET Framework version in question. Honestly, with Windows 10 now including .NET Framework updates along with feature upgrades every six months, and the fact that pre-Windows 10 versions of Windows haven't that many more years to live, it feels like that advantage isn't as big as it used to be anyways. My concern is .NET Core may lead to a lot of unnecessary software bloat. Where Windows has the current .NET Framework, but we still have to have six versions of .NET Core installed, and then half the programs on the computer don't use those and have their own bundled versions as well. I find .NET Framework already being on-system to be a big perk of writing my app with it: My software is a 7 MB file because most of the code is already built into Windows.
- deleted 8y ago[deleted]
- muterad_murilax 8y agoHopefully we'll now see fixes for some of the more well-known bugs in WinForms that Microsoft have ignorerad for a decade or so...
- badsectoracula 8y ago> WinForms is still IMHO the hands-down most convenient way to quickly assemble a GUI for an app I think Lazarus[0] is easier, especially when it comes to automatic layout stuff, but WinForms is very close. They're somewhat related as both are descendants of the classic Visual Basic RAD approach and Lazarus is basically an open source and cross platform clone of Delphi while WinForms implements a very VCL-like (VCL is Delphi's framework) API - which is natural since both Delphi and WinForms were designed by the same person :-P. [0] http://www.lazarus-ide.org/ http://www.lazarus-ide.org/
- int_19h 8y agoHow does Lazarus handle layout?
- badsectoracula 8y agoThere are several ways. The simplest is setting the "Align" property of a control which is similar to the "Dock" property of WinForms in that it makes the control stick to the left/right/top/bottom edge (multiple controls stack) or fill the "client" area. It also has an "Anchor" property that again works similar to WinForms' property of the same name, allowing anchoring an edge to the location you place the control. Beyond the above (which i think are all what WinForms provide, at least from the visual designer) the anchors can also be set so that instead of just "sticking" to a designed edge, they are set relative to some other control in the parent container with customizable gaps. For example you can configure (using a dedicated anchor editor window) that the left edge of an input box is 5 pixels away from the right side of the label control and the label control's top edge is aligned so that the label's center matches the edit box's center. Note that any control can be anchored to any other control, so if you have a form with 10 input fields you can anchor their left side to the same control (e.g. the longest label or a "guide" control) so that they align neatly. The align property is enough for most cases and the anchor system covers almost the rest of the layout cases. Where those do not suffice, there are a few more dedicated options like the TFlowPanel container that flows controls in various formations as well as the ChildSizing property that allows for specifying some automatic layouts. TBH personaly i never had to use those though. Note that most of them can also be combined. Finally each control also has constraints (min/max size) and spacing (margins) for each edge as well as an overall spacing. Somewhat related, but you can also make pretty much any control dockable by setting its DragKind property to dock and DockMode property to automatic. Docking happens in "dock sites" which are basically any container (like a panel) that has its DockSite property set to true (and preferably, although not required, its AutoSize also to true) and since containers are regular controls they themselves can be laid out using any of the above options or be anchor targets for sibling controls. The framework handles the whole drag/drop, docksite resizing, creating popup windows for tearoff docks, etc. In fact the whole docking system is modular itself and there are a couple of different docking managers that provide quite advanced options. Note that all i've mentioned so far are done with the visual designer, there is obviously more fine grained control by writing code.