private void ShowDropDownDialog() { if (Globals.AccessToken == null) // Not logged in { if (!Globals.LoginWindowOpen) { Globals.LoginWindowOpen = true; BrowserWindow bw = new BrowserWindow(); Globals.LoginWindowOpen = false; } } else { if (!DropForm.isOpen) { DropForm.isOpen = true; DropForm df = new DropForm(); // bring the form to front df.Show(); df.Activate(); // hack to keep it open (by preventing the thread from ending) df.Hide(); df.ShowDialog(); DropForm.isOpen = false; } } }
void ni_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (Globals.AccessToken == null) // Not logged in { if (!Globals.LoginWindowOpen) { Globals.LoginWindowOpen = true; BrowserWindow bw = new BrowserWindow(); Globals.LoginWindowOpen = false; } } else { //MessageBox.Show("content", "title"); if (!DropForm.isOpen) { DropForm.isOpen = true; new DropForm().ShowDialog(); DropForm.isOpen = false; } } } }