Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A lot of Windows Forms is non-Win32 controls with custom drawing, by the way. Especially things like menus, toolbars, etc. So a lot of Windows Forms controls are basically as native as WPF controls (just a lot harder to work with imho).


Are you sure? The source is available for both Core and old .NET and to me they all seem to be Win32 controls with some customization... unless I'm missing something. AFAIK WPF uses DirectX for rendering, so it's a bit different (it's more like Flutter... or a game engine).

Button: https://github.com/dotnet/winforms/blob/master/src/System.Wi... / https://referencesource.microsoft.com/#System.Windows.Forms/...

Toolstrip (also base for menu): https://github.com/dotnet/winforms/blob/master/src/System.Wi... / https://referencesource.microsoft.com/#System.Windows.Forms/...


Okay, perhaps my wording was off. Yes, they're Win32 controls in that sense, but many (most?) of the newer controls are no longer mere wrappers around something that exists in Win32, but rather implement all functionality in managed code, both behavior and drawing.


True and what’s more, Microsoft recently deprecated a load of Wi 32 native controls like Menubar and Toolbar where they now want you to migrate to the managed code / styled MenuStrip and ToolStrip.


> no longer mere wrappers around something that exists in Win32, but rather implement all functionality in managed code, both behavior and drawing

But that's how we do custom controls in Win32. You can get very far with only common controls, but as soon as you need something more complicated you have to draw it yourself. Just because they're using C# doesn't mean it's not the same API or is not native controls.

WPF on the other hand is completely different, internally it only uses native calls to get the canvas where everything will be drawn and to handle input/accessibility (plus a few other things).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: