My question is not a problem indeed because i could solve it. I need someone who can explain why i was having that problem. In my original code i had
int id1 = 1;
int id2 = 2;
FormAgregarProducto Agregar_Producto = new FormAgregarProducto();
FormCaracteristicas Caracteristicas = new FormCaracteristicas();
Deposito deposito1 = new Deposito(id1);
Deposito deposito2 = new Deposito(id2);
Then when i was passing the arguments, it throwed "A field initializer cannot reference the nonstatic field, method, or property" so my solution was only putting static to the variables like this
static int id1 = 1;
static int id2 = 2;
FormAgregarProducto Agregar_Producto = new FormAgregarProducto();
FormCaracteristicas Caracteristicas = new FormCaracteristicas();
Deposito deposito1 = new Deposito(id1);
Deposito deposito2 = new Deposito(id2);
I barely understand my simple solution. Could someone explain to me why the error and what happen when i put static variables. Regards