8
I’m doing an interface in Visual Studio 2015, how do I hold an event just once?
For example:
private void textBox5_Click(object sender, EventArgs e)
{
textBox5.ForeColor = Color.Black;
textBox5.SelectAll();
textBox5.Text = "";
}
When the user clicks on the text box, the color changes to black, and then selects everything and clears.
But I want this to happen only once, that is, if the user clicks again do not do any action.
You can also ask the color. If it is Forecolor == Color.Black does nothing.
– Guilherme Guini
It would work, but it would be a gambiarra kkkkk The same is how the response people sent (textBox5.Click -= textBox5_Click;)
– Maurício Salin