C # is frozen and does not accept new changes

0

My problem is that I want to add new changes to my forms, but every time I add new methods or actions these are not displayed in the application.

I currently remove a button from the form and execute that same form but the button I had deleted appeared.

Form in the visual studio editor:

Form when running it

    
asked by David 20.01.2017 в 21:58
source

2 answers

2

The solution to this problem is the possible cache that accumulated during the entire development process and solve it by generating the project in Visual Studio again.

  • First go to the Solution Explorer box
  • after that, get on the solution of C #
  • then left click you will see a new menu
  • inside that menu click on return to gener.
  • answered by 23.01.2017 / 18:59
    source
    1

    I do not find any relationship in the error when opening your new form, it seems that your second form contains an unhandled error and the first form is the one that gets the exception, says the code:

    this.Close();
    

    and encapsulate the rest in a block:

    private void btnCompra_Click(object sender, EventArgs e)
    { 
        try 
        {
            this.Hide();
            Modal_compra compras = new Modal_compra();
            compras.ShowDialog();
            //this.Close();
        }
        catch (Exception ex)
        {
             MessageBox.Show(ex.ToString());
        }
    }
    
        
    answered by 20.01.2017 в 22:20