You could create your own Textbox inheriting from System.Windows.Forms.Textbox and then override the WndProc.
The WndProc is the initial method which receives messages about everything from the operating system, power messages, input, etc. The name of the method is a throwback to the Win32 (and Win16) days where one of the two main functions you would implement was the "WndProc" or Windows Procedure.
By doing so, you can now intercept the windows messages for the mouse (or any other message) prior to the events being dispatched to the base implementation.
In the below example, we do not pass on any Left button down, up or double click to the base control to process.
public partial class MyTextBox : TextBox
{
int WM_LBUTTONDOWN = 0x0201; //513
int WM_LBUTTONUP = 0x0202; //514
int WM_LBUTTONDBLCLK = 0x0203; //515
public MyTextBox()
{
InitializeComponent();
}
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_LBUTTONDOWN ||
m.Msg == WM_LBUTTONUP ||
m.Msg == WM_LBUTTONDBLCLK // && Your State To Check
)
{
//Dont dispatch message
return;
}
//Dispatch as usual
base.WndProc(ref m);
}
}
Only thing left to do is adding checking for your state to determine when to pass on the messages or not.
You can find a list of the Windows messages to process here.