Being more precise, I am trying to add (at the moment) some buttons to a form of c #, my dilemma is that I have no idea how to add these elements from the default class that has all the forms of c # , and the examples that I have seen have not worked for me.
What I have at the moment is a failed attempt with AddOwnedForm.
this.productByUserList = myListProducts;
Point newLoc = new Point(5, 5); // Set whatever you want for initial location
//Se recorre la lista de elementos que quiero agregar, se define una posición por defecto y aunque los botones se agregan no logro que me muestre texto o agregarle estilos propios desde c#
foreach (productByUserObject productOfUser in this.productByUserList)
{
//Añadir elementos
Button buttonTest = new Button();
buttonTest.Size = new Size(10, 50);
buttonTest.Location = newLoc;
buttonTest.Text = productOfUser.name;
newLoc.Offset(0, buttonTest.Height + 5);
Controls.Add(buttonTest);
}
What I refer to as the default class is a
// a la clase que se crea junto con el formulario
public partial class productByUserForm : Form
{}
I'm looking for new updates that ask me