lundi 16 mars 2015

Stop sound when mouse is clicked outside modal form in WinForms

I have a modal form which I want to close when the user clicks outside it (the form tries to mimick the behaviour of the drop down area of a combo box).


I can to that like so:



protected override void WndProc(ref Message m)
{
if (m.Msg == 0x86 && (int) m.WParam == 0)
if (DialogResult == DialogResult.None)
DialogResult = DialogResult.OK;
base.WndProc(ref m);
}


My problem is that a sound is played at the same time, and I'd like to stop that.


Aucun commentaire:

Enregistrer un commentaire