I use a Boolean "flag" to control this.
A private property on the form e.g.
bool codeUpdate;
When I need to programmatically change something I first set the boolean to true, do my changes, then set it back to false e.g.
codeUpdate = true;
codeUpdate = false;
Then in each of the control's events that I want to
not fire if I'm doing it in code I have a single line
if (codeUpdate) return;
This is very old-school by the way!
A more modern approach might be to actually unhook the event(s) entirely while you make your programmatic changes e.g.
DatePicker1.ValueChanged -= DatePicker1_ValueChanged);
DatePicker1.ValueChanged += DatePicker1_ValueChanged;
I prefer the first approach - to me it's clearer what's going on, especially if you use an appropriately named variable. I'm sure someone will put forward an alternative argument though.
To be honest, I probably wouldn't keep changing the Max Date through the Enter event. I would just validate the DatePicker value against "yesterday" in the ValueChanged event then this problem just goes away