![]() |
|
[C#] [C#] Auto controls resizer - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] [C#] Auto controls resizer (/showthread.php?tid=5940159) |
[C#] Auto controls resizer - Anon Scripter - Feb 11, 2019 Hi. When i first started coding, i had trouble with make an auto-resizer for the forums. But now, since i have 6 years of experience, it was hella easy to make, so im releasing it! :) (Dont forget to vouch 🤝 ) The good stuff: This goes under SizeChanged: Code int nextH = (this.Height - current.Height);Code Size current = new Size();Put this in Form_Load: Code current = this.Size;RE: [C#] Auto controls resizer - 0xDEAD10CC - Feb 11, 2019 What's wrong with using the Anchor property? 6 years and you haven't discovered that yet? 🤨 Code Size current = new Size();I also don't see why you're using a Dictionary like this. It doesn't do anything more than a simple collection would because you're still looping through everything anyways by iterating the keys, and doing a lookup from there, rather than just looping through all of the KeyValuePair<TKey, TValue> entities. As long as the hashcode is unique the only thing it does is prevent the same control from being added. |