How do i create a new button on a stackpanel perhaps in a class file
public static void addbtn() { Page1 p1 = new Page1(); Button btn = new Button(); p1.stackPanel1.Children.Add(btn); }
I'm sure this isnt really right, at the same time how do i give it a event handler.
My objective is to create a button on form1 with a click of a button from form2.
Please help me with this. Thank you!