Winforms C# | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Winforms C#

So I'm trying to send data from 1 form, to Another. I have a button on 1 form(Form2) that opens a color dialog and should change the background of Form1 when Form2 closes. But it just doesn't work correctly. It assigns the data, but I can't update the current form. How can I do this? TL;DR I want Form2 to change the background color for Form1. How?

5th Apr 2020, 7:17 PM
Daniel Cooper
Daniel Cooper - avatar
2 Answers
+ 1
Maybe try making a method in Form1 like ChangeBackgroundColor(), and in Form2 make a new instance of Form1 and call the method.
5th Apr 2020, 10:34 PM
inxanedev!
inxanedev! - avatar
0
InxaneNinja That didn't work. Thanks tho.
6th Apr 2020, 4:20 PM
Daniel Cooper
Daniel Cooper - avatar