Reputation: 2020
I have multiple windows in a wpf project. in any window, i put a control (such as button). as position of controls in all windows is same. i define a MouseLeftButtonUp event for controls in all windows. with click (mouse left button up) on the control, i create and open dialog next window. for example for first window:
Window2 win2 = new Window2 ();
win2.Owner = this;
win2.ShowDialog();
but my problem:
if i do double click or triple click on the button of first window, since all position controls in all windows is same, all two or three windows opening as cascading. and i want open only one next window.
thanks for your answers
Upvotes: 2
Views: 2269
Reputation: 28120
Have you considered disabled the button initially and enabling a second after the form has loaded? You can do this using a timer.
Upvotes: 0
Reputation: 59111
See my comment above. You may want to consider this to be "by-design", and not fix it.
If you do decide to fix it, you could implement a form of de-bouncing.
DateTime.MinValue
(or whatever it is called).DateTime.Now
TimeSpan.FromMilliseconds(500)
), then don't create a new windowUpvotes: 4