Camilo Posted August 20, 2003 Posted August 20, 2003 I have a sub that is run on every textbox on the screen and it's executed when there is a change in the text or in other words using the on textchanged event but they are all fire when the mdi form is loading so does anybody know if there is a onfinish loading event or something like that? Quote
aewarnick Posted August 20, 2003 Posted August 20, 2003 If it is a problem put a bool value under InitializeComponent() setting it to true. (The bool variable must be global). Also, in your text changed events use the same bool value and only execute the code if it is true. Quote C#
*Experts* Nerseus Posted August 21, 2003 *Experts* Posted August 21, 2003 We try a similar trick, but not using the extra variable: if(this.ActiveControl!=(Control)sender) return; Seems to work until the form is shown. Normally, you don't care about an event unless that control has the focus. This may not be true if you rely on events to either cascade or if you want to set a property and have the event fire for you. The TextChanged is a bad example, but suppose you were using the ComboBox's IndexChanged - it fires whenever you set the SelectedIndex property through code. I only mention the above because some people *hate* these types of form level flags. Me, I use them if they're needed (I call mine bInitializing :)) -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.