protected void Grid_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Tab: e.SuppressKeyPress = true; if (e.Modifiers == Keys.None) { BackButton.Focus(); } else if (e.Modifiers == Keys.Shift) { CancelCloseButton.Focus(); } break; case Keys.Enter: e.SuppressKeyPress = true; BrowseButton.PerformClick(); break; case Keys.Back: e.SuppressKeyPress = true; BackButton.PerformClick(); break; } }
private void OKButton_Click(object sender, EventArgs e) { if (NI != null) { ACS.SendPCStatus(NI, ALEmanCafeServer.MessageStatus.sendmessage, false, 0, false, null, richTextBox1.Text); } else { foreach (NetworkItems NI2 in NetworkItems.ALLNetworks.Values) { if (string.IsNullOrEmpty(NI2.IP) == false) { ACS.SendPCStatus(NI2, ALEmanCafeServer.MessageStatus.sendmessage, false, 0, false, null, richTextBox1.Text); } } } CancelCloseButton.PerformClick(); }
private void OKButton_Click(object sender, EventArgs e) { double HP = Program.HourPrice; double MC = Program.MinimumCost; try { HP = Convert.ToDouble(this.HourPrice.Text); MC = Convert.ToDouble(this.MinimumCost.Text); } catch { } Program.HourPrice = HP; Program.MinimumCost = MC; Program.MyUserName = this.UserTextBox.Text; Program.MyPassword = this.PassTextBox.Text; Program.Askpasswordonstartup = this.Askpasswordonstartup.Checked; Program.EnableUSBPluginWarning = this.EnableUSBPluginWarning.Checked; Program.EnableUSBPlugoutWarning = this.EnableUSBPlugoutWarning.Checked; MyDatabase.Save(); CancelCloseButton.PerformClick(); }