TextBox4_ChangedText

  • Thread starter Thread starter Jim Richards
  • Start date Start date
J

Jim Richards

Hello. Using XP Pro w/SP4 and VS 2003.
Is it normal for this procedure to run before I have even seen the
Form1? I can write code to work-around this.
I believe that what it is doing is as soon as TextBox4 is initialized, it is
detecting the text in the TextBox4.Text property (which is TextBox4) as a
changed text so it runs the TextBox4_ChangedText proceedure.
Will appreciate any explanation on this and have a good day, Jim
 
Jim Richards said:
Hello. Using XP Pro w/SP4 and VS 2003.
Is it normal for this procedure to run before I have even seen the
Form1? I can write code to work-around this.
I believe that what it is doing is as soon as TextBox4 is initialized, it
is
detecting the text in the TextBox4.Text property (which is TextBox4) as a
changed text so it runs the TextBox4_ChangedText proceedure.
Will appreciate any explanation on this and have a good day, Jim

The event is going to firer anytime you address the textbox, even during the
load of the form. It could be a case that you must load a textbox during the
Form_Load with data.

In any case, you must set a flag at Form_Load like bFormLoad = true and set
bFormLoad = false after the Form_Load.

Then when the Textbox_Changed event firers doing the Form_Load when
addressing the Textbox, if bFormLoad = true, then you bypass the code in the
event. Then after Form_Load when you set bFormLoad = false, you are safe to
execute the code in the event, because the user entered data in the Textbox,
after the Form_Load.
 
Back
Top