My code inexplicably executes while in the IDE

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I've written a validatedTextBox control which inherits
from textBox and among other things checks if the text box
is blank, and colors the background pink and issues an
error message via msgBox if it is. It is in its own DLL
and executes perfectly when I use it.

The mystery is that while I am in the IDE and doing simple
things in the form designer like going from one tab to
another on a tabcontrol (which contains some of my
validatedTextBoxes) my code appears to execute (a textbox
turns pink and I get the msgBox). I'm a newbie and
wouldn't know how to make code execute while using the
form designer if I wanted to, so needless to say I've no
idea what is wrong or how to fix it. I'm not posting the
code because it is pretty long, but if necessary I will.

Just to be clear. I am NOT running the program when this
happens. I am using the form designer. Also, if I set a
breakpoint in where the validatedTextBox does the msgBox,
it does not stop there.

Any suggestions? Thanks
 
I've written a validatedTextBox control which inherits
from textBox and among other things checks if the text box
is blank, and colors the background pink and issues an
error message via msgBox if it is. It is in its own DLL
and executes perfectly when I use it.

The mystery is that while I am in the IDE and doing simple
things in the form designer like going from one tab to
another on a tabcontrol (which contains some of my
validatedTextBoxes) my code appears to execute (a textbox
turns pink and I get the msgBox). I'm a newbie and
wouldn't know how to make code execute while using the
form designer if I wanted to, so needless to say I've no
idea what is wrong or how to fix it. I'm not posting the
code because it is pretty long, but if necessary I will.

Just to be clear. I am NOT running the program when this
happens. I am using the form designer. Also, if I set a
breakpoint in where the validatedTextBox does the msgBox,
it does not stop there.

Any suggestions? Thanks

The control is live in the IDE :) So, you might want to look at the
..DesignMode property to determine if code should be run or not...

If Not Me.DesignMode Then
' do your checks....
End If

HTH
 
Back
Top