The text control loses focus before the button click occurs (possibly before it even gets the mouse-button-down message, not sure about that), causing the MessageBox to be shown. The MessageBox this calls up is modal and disables the button before the button gets the button-up message that makes the button "click".
Modal dialog boxes have their own message loop so that they don't have to return from ShowDialog immediately, but they also disable their calling/owner/parent (I forget which) window until they return.
It is not a matter of which message loop is handling the mouse-button-up message, but of the relative timing of this message and the button control being disabled by the modal form being shown. Think about what the timing would be if you clicked and held the mouse button for a second or two. I suspect you would find that the MessageBox appears before you release the mouse button.