How to make an element disappear after it is used?

4

How to make an element disappear after being used for example:

  

When clicking on a button it disappears and something like a ListBox appears?

Ps1: If the question is confusing, let me know

Ps2: If you can tell what to do for the button to come back it will help a lot

    
asked by anonymous 11.05.2017 / 13:23

1 answer

6

You can use the methods < strong> Hide() and Show() of its elements to hide and display respectively.

button1.Hide(); //Esconde o Botão
button1.Show(); //Exibe o Botão

This can also be used for other graphics components you like

label1.Hide();
listBox1.Hide();

By simply adding the codes in the sequence of actions you want, as in the example you mentioned:

private void button1_Click(object sender, EventArgs e)
{
    button1.Hide(); //Esconde o Botão
    listBox1.Show(); //Exibe o ListBox
}
    
11.05.2017 / 13:32