I'm doing a parking system, in which the need arises when the user registers, in the main form appears an icon of a car over his seat (which is a label), that is, when he clicks on the 'sign up' button in the other form, the main form has to appear a car icon on top of the vacancy of it!
I tried the following way, in the click of the button of the registration form I instantiated a constructor of the main form, and in the constructor of the main form, I passed the image that should go to the label, however it did not work! p>
// Click the register button, the form register, first I create the object after instantiating the form1
private void button1_Click(object sender, EventArgs e)
{
Cadastro cadObj = new Cadastro(Convert.ToString(horas), txt_placa.Text, txt_cor.Text, txt_modelo.Text);
var formulario1 = new Form1(Properties.Resources.vermelho);
btn_registrar.Enabled = false;
}
// The main form constructor that is called in the click of the button to register
public Form1(System.Drawing.Image imagem)
{
InitializeComponent();
box15.Image = imagem;
}
I just need that when I click on register the icon of a car go to the label, to indicate that there is someone already there in the vacancy!