B
Brian Richards
In my app I have some actions that take some time. So when a user clicks on
a button to perform said action in the event handler I set the cursor to
waitcursor and disable the button. What I was trying to accomplish was
preventing the user from inputing multiple events. What happens is the
messages just get queued up and the event handler fires off again. Is there
anyway for me to ignore those events all together? I'd like to be able to do
it at the control level but application wide may be acceptable.
The other method I tried was overriding the preprocessmessage function to
throw away all events if the forms busy flag is set like the following:
public override bool PreProcessMessage(ref System.Windows.Forms.Message msg)
{
if(!_busy)
{
return base.PreProcessMessage(ref msg);
}
else
{
//busy just return true
return true;
}
}
Any tips would be welcomed. Thanks.
-Brian
a button to perform said action in the event handler I set the cursor to
waitcursor and disable the button. What I was trying to accomplish was
preventing the user from inputing multiple events. What happens is the
messages just get queued up and the event handler fires off again. Is there
anyway for me to ignore those events all together? I'd like to be able to do
it at the control level but application wide may be acceptable.
The other method I tried was overriding the preprocessmessage function to
throw away all events if the forms busy flag is set like the following:
public override bool PreProcessMessage(ref System.Windows.Forms.Message msg)
{
if(!_busy)
{
return base.PreProcessMessage(ref msg);
}
else
{
//busy just return true
return true;
}
}
Any tips would be welcomed. Thanks.
-Brian