Wait for mouse double click

Topics: Windows Forms
Feb 20, 2013 at 11:07 PM
Hi,

My scenario is a Map Control as background of a MDI Form and I have all my sub-forms showed over map. Inside those sub-forms I have a button to obtain coordinates from Main Map, when I click in that button, my sub-form will be hide, and I need some function to wait for mouse double click over Main Map and dispatch an event to get Screen coordinates. But I can't make this... can someone help me?
private void butGetCoordinates_Click(object sender, EventArgs e) {
            this.Hide();
            MainForm main = new MainForm();
            PointLatLng coords = main.GetInstance().coordenadas;
            main.MainMap.MouseDoubleClick += main.MainMap_MouseDoubleClick;
            
            /* WHAT SHOULD I PUT HERE TO WAIT MOUSE DOUBLE CLICK??? */

            main.MainMap.MouseDoubleClick -= main.MainMap_MouseDoubleClick;
            MessageBox.Show(coords.Lat.ToString() + "/" + coords.Lng.ToString());
            this.Show();
        }
Coordinator
Feb 21, 2013 at 2:37 PM
try using MainMap_MouseDoubleClick with some logic for clicking once
Feb 22, 2013 at 11:20 AM
Any ideia about how to do it?

That logic for wait the mouse click that is missing because the request is coming from a MDI Child Form acting over the Main Form.