i have a application where
Scenario : when i click on that textbox the cursor should not point the textbox it should be disabled
how do i achieve this disabling the textbox
textbox1.focus()=false;
textbox1.focused()=false;
i have a application where
Scenario : when i click on that textbox the cursor should not point the textbox it should be disabled
how do i achieve this disabling the textbox
textbox1.focus()=false;
textbox1.focused()=false;
You can set this.ActiveControl = null;
with this is your Form
This code no control is active and your textbox lost focus too.
private void YourForm_Load(object sender, EventArgs e)
{
this.ActiveControl = null;
}
To disable a textbox:
textBox.IsEnabled = false;
To not focus the textBox just focus on an other element.
For example on a Forms class:
this.Focus();