1

I'm super new to C# so please bear with me. While I'm playing around and trying different things to understand and learn C# better, I came across a problem I've been trying to figure out for a while with no success.

I added ModernUI to my forms. I am able to change the theme and color of the forms. However, what I'm trying to do is from the main form call a child form called settings, allow the user to change the theme and color from that form and apply the theme to all other child forms and mainform.

I searched and watched some videos on youtube. I emailed someone who was able to do this and he said you have to use "clone".

He sent me this code as an example but I still couldn't figure out how to implement this.

((Main)this.Parent). StyleManager.Clone

Can anyone help me how to do this?

Thank you everyone in advance.

Besiktas
  • 331
  • 1
  • 6
  • 23

1 Answers1

1

After struggling and trying everything I was able to figure it out. For those who are struggling here is how I did it.

form2 _form2 =new form2();
this.StyleManager.Clone(_form2);

Hope this will help.

Besiktas
  • 331
  • 1
  • 6
  • 23
  • It took a long time, trying solutions and creating extension methods to achieve this and without getting the expected result, **Thanks `Clone (...)` solved my problem**. – J. Rodríguez Oct 05 '18 at 12:41