fork download
  1. private void sDoubleBox_KeyPress(object sender, KeyPressEventArgs e)
  2. {
  3. if (e.KeyChar == ' ') //禁止空格键
  4. {
  5. e.Handled = true;
  6. return;
  7. }
  8. if (((TextBox)sender).Text.Equals(((TextBox)sender).SelectedText)) //處理全選
  9. {
  10. ((TextBox)sender).Text = null;
  11. }
  12. if ((e.KeyChar == '-') && (((TextBox)sender).SelectionStart == 0)) return; //處理負號
  13.  
  14. if (e.KeyChar > ' ')
  15. {
  16. try
  17. {
  18. double.Parse(((TextBox)sender).Text + e.KeyChar.ToString());
  19. }
  20. catch
  21. {
  22. e.Handled = true;
  23. }
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,8): error CS1525: Unexpected symbol `void', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty