-3

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;
fedrick
  • 1
  • 2

2 Answers2

1

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;       
}
Hien Nguyen
  • 24,551
  • 7
  • 52
  • 62
0

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();
programmer444
  • 156
  • 1
  • 5