Changing the property Enabled
for false
, or the property ReadOnly
for true
.
In most components, change the value of ReadOnly
keeps the control with the same appearance, but prevents some value from being inserted. In contrast, the Enabled
shows the control with a slightly different appearance. But this at all times will vary as the operating system, in the form below the first Textbox is normal, the second is with Enabled
as false
and the third is with ReadOnly
active.
You can do this in the code, in the form builder
public MeuForm()
{
InitializeComponents();
txtId.Enabled = false;
}
Or in the properties window, by Visual Studio.
puts him as Readonly only only
– Rovann Linhalis