MyUiTextInput.cs 839 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Sunny.UI;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows.Forms;
  9. using Permission;
  10. public class MyUiTextInput : MyUiInput
  11. {
  12. public MyUiTextInput()
  13. {
  14. }
  15. protected override void OnCunstomClick(EventArgs e)
  16. {
  17. // 执行软键盘逻辑(由子类或当前类决定)
  18. if (UseSoftKeyboard)
  19. {
  20. ShowSoftKeyboard();
  21. }
  22. }
  23. private void ShowSoftKeyboard()
  24. {
  25. // 父类的默认行为:弹出软键盘
  26. var kb = new FullKeyboardForm(Text);
  27. kb.PasswordChar = PasswordChar;
  28. var dr = kb.ShowDialog();
  29. if (dr == DialogResult.OK && kb.ValueChanged)
  30. {
  31. Text = kb.Value;
  32. }
  33. }
  34. }