Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Handling Events in C#

Apr 4 2003 4:23 PM
Does anyone know why some events won't EVER fire for their particular control. For example the datagrid listed a key off event, but I could never get it to fire. I could get a double click to fire, but never the key off. Another example is as follows: You have a tree with several levels of nodes. Nodes on the same level can have different data but share the same form layout. If you open a level 2 form and type text into a textbox and then immediately click on a different data set for a form that is also on level 2, the event that the textbox changed NEVER fires. The only way you CAN get it to fire is if you clicked on a form at a different level, or while staying in the same form click/tab/key off after entering data in the text box inorder to get the textbox change event to fire. I suppose I could check every field in the form before going to a new form...but that seems contrary to the idea of event handling. I entered new data into the text box, that's my event and it should be picked up regardless of what action happens immediately after entering the new text. I have successfully setup events that fire. So I understand the process. I am baffeled by the fact that just because an event is listed for a control, does not mean that it will necessarily fire for that control. Any experience or remedies for this will be greatly appreciated. Thanks!