1
I have userControlVicles inside a Panel, in this Usercontrol has a button to register a new vehicle, I want that when you click the button the panel closes or hide the current Ucontrol and show the new, I managed to show the registration, but I can’t make the old one go away..
private void metroButton1_Click(object sender, EventArgs e)
{
UserControlCadastroVehicle userControlCadastroVehicle = new UserControlCadastroVehicle();
panel1.Controls.Add(userControlCadastroVehicle);
panel1.Controls.Remove(this);
}
I thought Remove(this) would close the Usercontrol I was, but it didn’t work, Hide() it goes away, but then add it all up, until the registration I opened.
It looks like this when I click to register