What event fires when data is typed into a field?

  • Thread starter Thread starter foo
  • Start date Start date
F

foo

Hello,

What event will fire when a user types data into a field and then the field
loses the focus but does not fire when a field is filled programatically? I
don't want the event to run when I'm initializing the field via code, but
the Change Event fires regardless of how the field was changed.

Thanks,

Bill Nicholson
Cincinnati, OH USA
 
Hi Foo,

About what kind of field are you talking in a textbox, datagrid, combobox,
listview etc. etc?

Cor
 
Hi Foo,

Then there are a lot of events I like the most the keyup for typing

Than you have the leave for the second situation you said.

I hope this helps,

Cor
 
Hi Herfried,

I thought not textChanged, does that not fire when it happens
programmaticly?

Cor
 
Hi Herfried,

This was the question from the OP
-------------
What event will fire when a user types data into a field and then the field
loses the focus but does not fire when a field is filled programatically? I
don't want the event to run when I'm initializing the field via code, but
the Change Event fires regardless of how the field was changed.
-------------
This the answer from Herfried

'TextChanged'.
--------------
On my question if that was right you gave this answer
Why not try it yourself?
--------------
In my opinion this is not an answer to someone who ask a question, but if it
is your style, do it. I have never threath you like this and I never will.

But I did try it and I expect an answer what was the result when you did try
this?

\\\
Private Sub TextBox1_TextChanged(ByVal _
sender As Object, ByVal e As System.EventArgs) Handles
TextBox1.TextChanged
Me.BackColor = Color.Red()
End Sub

Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Text = "To help Herfried a little bit"
End Sub

Private Sub TextBox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
Me.BackColor = Color.Blue
End Sub
///

Cor
 
* "Cor said:
In my opinion this is not an answer to someone who ask a question, but if it
is your style, do it. I have never threath you like this and I never will.

Sorry, my newsreader didn't show the OP's message, it seems to be too
old for my newsreader to be displayed... So I missed that the event
should not be fired when changing the textbox's content
programmatically.
 
Accepted
:-)
will.

Sorry, my newsreader didn't show the OP's message, it seems to be too
old for my newsreader to be displayed... So I missed that the event
should not be fired when changing the textbox's content
programmatically.
 
Back
Top