C# Tutorial: Add Draggable Auto-Aligning Buttons to Your C# Programs

Опубликовано: 17 Октябрь 2024
на канале: Code With Huw
2,206
40

You have a Windows Forms project and you want to be able to drag buttons to change the layout around at runtime. And, what’s more, you want the buttons to auto-arrange themselves after you’ve dragged them.

The auto-arranging part is easy. I’ve shown in previous videos how you can use a WinForms flowLayoutPanel to do that. I’ve also previously shown how to drag controls on a form. What isn’t so easy is combining draggable controls with a flowable layout. In this video, I show you everything you need to do in order to make this work.

For more C# Programming Projects, see this Playlist:    • C# Programming Projects  

To understand file launching, I’d also recommend that you watch my lessons on programming a Disk Browser – which you can find here:    • How to Program A Disk Browser in C#  

Huw Collingbourne is author of numerous books on programming C, C#, Java, Ruby, Delphi and Object Pascal, pointers, recursion and programming adventure games. Find them all on Amazon.

To learn C# quickly, Huw’s book, available in paperback or for Kindle, is the perfect complement to these YouTube lessons.
The Little Book Of C# Programming (Amazon US): https://amzn.to/2JWDI0o
The Little Book Of C# Programming (Amazon UK): https://amzn.to/2YaCPtS

Keep in Touch
==============================
Subscribe to the Code With Huw YouTube channel: https://www.youtube.com/CodeWithHuw?s...

Code With Huw on Facebook:
  / codewithhuw