event synchronisation

Oct 19 2006 10:40 AM
Hi, Here's my problem: I have 2 Textboxes (txt1 and txt2). I habe connected both Textboxes with the GotFocus and LostFocus event. In GotFocus I set a value(class variable) wich I read in LostFocus. [CSHARP] int x = 0; void txt_GotFocus(object sender, EventArgs e){ x = Convert.ToInt32(((TextBox)sender).Text); ((TextBox)sender).Text = "101"; } void txt_LostFocus(object sender, EventArgs e){ //do sth if ( x == 0 ){ ..... } } [/CSHARP] When I jump from txt1 in txt2 the events are triggered and it can happen that the GotFocus event sets the class variable before it can be readed in the LostFocus-event from txt1 Is it possible to synchronise the events? Thanks in advance Florian