C
C#2y ago
tajgel

❔ WinForms buttons

I have 5 buttons in WinForms and I want to change their color to green. How do I do it without writing it five times in the function for each of them.
7 Replies
ACiDCA7
ACiDCA72y ago
create a method and then reuse the method. its then just 1 line instead of 5 winforms is frigging old and doesnt have many nice things.. if you can use something newer i would recommend it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2y ago
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework. .NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended. https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
HtmlCompiler
HtmlCompiler2y ago
you can make a button array if i remember well anyway you could loop on all the buttons in the form controls' array
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server