By the code and comments you only need to lock the typing, instead of using Enabled
that is very restrictive and disables even use events ReadOnly
:
private void button6_Click(object sender, EventArgs e)
{
textBox4.Text = "Texto Padrão";
textBox4.ReadOnly = true;
}
To appear when a double click
that it is locked for typing, go to the event box and use DoubleClick
:
private void textBox4_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show("Bloqueado !!!");
}
To start the TextBox
unseen:
Form_Load
private void Form1_Load(object sender, EventArgs e)
{
textBox4.Visible = false;
}
or property bank:
Web or Windows Forms?
– novic
Windows Forms, sorry we do not clarify
– user39571
Yes, but I’m saying that when you click on the button it blocks and it’s already typed. It’s like you have a default value and you can’t edit
– user39571
That, and also wanted to know how to do for when click the button the textbox appears locked with the default value
– user39571