InputDialog.cs 614 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace SheepSheep
  8. {
  9. public static class InputDialog
  10. {
  11. public static DialogResult Show(out string strText, string title)
  12. {
  13. string strTemp = string.Empty;
  14. FrmInputDialog inputDialog = new FrmInputDialog(title);
  15. inputDialog.TextHandler = (str) => { strTemp = str; };
  16. DialogResult result = inputDialog.ShowDialog();
  17. strText = strTemp;
  18. return result;
  19. }
  20. }
  21. }