Skip to content

Instantly share code, notes, and snippets.

@noseratio
Last active November 16, 2021 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noseratio/bafc14887bd7b2e3c8d21916daafcd59 to your computer and use it in GitHub Desktop.
Save noseratio/bafc14887bd7b2e3c8d21916daafcd59 to your computer and use it in GitHub Desktop.
Wish list for WinForms in .NET 7.0

Now in WinForms discussions: dotnet/winforms#6184


  • An option on WindowsFormsSynchronizationContext to prevent pumping while blocking, see how it may affect folks using SkiaSharp: mono/SkiaSharp#1383 (comment)

    (or unseal WindowsFormsSynchronizationContext to be subclass-able, so we can overrride SynchronizationContext.Wait)

  • inb4, a proper Control.InvokeAsync, see how this currently affects BlazorWebView: dotnet/maui#2313

  • FlowLayoutPanel's children anchoring behavior (they don't fully stretch). I don't understand why the child controls are stretched to the widest peer, while they are set to anchor or dock to the parent panel's right/left. I had to come up with a workaround that attaches a custom resizing behavior to each child control, which triggers in when the parent FlowLayoutPanel changes its size.

    In my opinion, TableLayoutPanel, FlowLayoutPanel, Docking, Anchoring and AutoSize are the most important building blocks for creating responsive UI in WinForms, it'd be great to have an option to enable consitent resizing behavior across them.

  • ShowDialogAsync API: https://stackoverflow.com/a/33411037/1768303

  • Work with the WebView2 team to solve the pending keyboard accelerators and focus handling intergration issues: https://github.com/noseratio/BlazorWebViewWinFormsApp.

    This might be tricky (given the out-of-proc nature of WebView2), but should be doable. A smooth integration with WebView2 is particularly important. I'm sure we'll see more and more of hybrid UI desktop apps in the wild. WinForms is an ideal host for WebView2 (just add a menu, status bar, tray icon and a WV2 control), but those are still the issues to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment