private void btnLog_Click(object sender, EventArgs e) { CatchText(); return; LogForm form1 = new LogForm(); form1.ShowDialog(this); }
public void KeyDown(Keys key) { if (!isGame) { StartGame(); return; } switch (key) { case Keys.A: case Keys.Left: _objects.Player.ChangeDirection(MobileObject.left); break; case Keys.W: case Keys.Up: _objects.Player.ChangeDirection(MobileObject.up); break; case Keys.D: case Keys.Right: _objects.Player.ChangeDirection(MobileObject.right); break; case Keys.S: case Keys.Down: _objects.Player.ChangeDirection(MobileObject.down); break; case Keys.Space: CreateBullet(_objects.Player); break; case Keys.R: StartGame(); break; case Keys.P: // Ставим на паузу _view.ActiveTimer = false; timer.Stop(); // Запускаем форму лога LogForm form = new LogForm(); ShowInfo(form); form.ShowDialog(); // продолжаем игру timer.Start(); _view.ActiveTimer = true; break; } }
/// <summary> /// 리스트뷰 더블 클릭 이벤트 /// </summary> private void lv_Click(object sender, MouseEventArgs e) { ListView lv = (ListView)sender; lv.FullRowSelect = true; ListView.SelectedListViewItemCollection itemGroup = lv.SelectedItems; for (int i = 0; i < itemGroup.Count; i++) { ListViewItem item = itemGroup[i]; mNo = item.SubItems[0].Text; //MessageBox.Show(mNo); LogForm log; log = new LogForm(mNo); log.ShowDialog(); } }
//显示登录窗口 public string ShowLogForm(string caption) { LogForm frmlogform = new LogForm(); frmlogform.Text = System.Convert.ToString(rms_var.apptitle + frmlogform.Text + caption); frmlogform.ShowDialog(); string str = ""; if (frmlogform.DialogResult == System.Windows.Forms.DialogResult.OK) //登录成功 { str = frmlogform.TextBox1.Text; //返回成功登录的操作员ID } else if (frmlogform.DialogResult == System.Windows.Forms.DialogResult.Cancel) //退出系统 { str = "-1"; } return(str); frmlogform.Dispose(); }