I want to add some buttons and/or shapes runtime on a form.
I can creat it, but I don't get it on the form:
Code: Select all
public void Button1_Click(System.Object sender, System.EventArgs e)
{
winButton btn = new winButton();
btn.Height = 40;
btn.Width = 300;
btn.BackColor = Color.Red;
btn.Name = "btn1";
this.Controls.Add(btn);
}
I get every time the messages:
'Neo.ApplicationFramework.Generated.Screen1' does not contain a definiation for 'Controls' and no extension method 'Controls' accepting a first argument of type 'Neo.ApplicationFramework.Generated.Screen1' could be found (are you missing a using directive or an assembly reference?)