lundi 29 mai 2017

How to Hide and Show a button with if statements

I am trying to make a button visible = false if a quantity in a text box is less than or equal to 0. The problem I am having is that you have to click the button in order to activate the function.

Here is my code so far

        int quantity = int.Parse(textBox33.Text);

        if (quantity <= 0)
            button13.Visible = false;

        if (quantity > 0)
            button13.Visible = true;

do I have to disable the visibility of the text box beforehand?

Aucun commentaire:

Enregistrer un commentaire