123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace OTSExtremum
- {
- public partial class InputValue : Form
- {
- public InputValue()
- {
- InitializeComponent();
- }
- public delegate void TextEventHandler(string strText);
- public TextEventHandler TextHandler;
- private void btnOK_Click(object sender, EventArgs e)
- {
- if (null != TextHandler)
- {
- TextHandler.Invoke(txtString.Text);
- DialogResult = DialogResult.OK;
- }
- }
- private void btnCancel_Click(object sender, EventArgs e)
- {
- DialogResult = DialogResult.Cancel;
- }
- private void txtString_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (Keys.Enter == (Keys)e.KeyChar)
- {
- if (null != TextHandler)
- {
- TextHandler.Invoke(txtString.Text);
- DialogResult = DialogResult.OK;
- }
- }
- }
-
- }
- }
|