❔ 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
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•2y ago
Message Not Public
Sign In & Join Server To View
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
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
you can make a button array if i remember well
anyway you could loop on all the buttons in the form controls' array
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.