| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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 MeterModuleLibrary
- {
- public partial class frmPhNo : Form
- {
- public frmPhNo()
- {
- InitializeComponent();
- }
- public string strValue = "";
- private void btnValue_Click(object sender, EventArgs e)
- {
- Button btn = (Button)sender;
- setTxtValue(btn, 0);
- }
- private void setTxtValue(Button btn, int m)
- {
- int i = txtValue.SelectionStart;
- txtValue.Focus();
- txtValue.Text = txtValue.Text.Trim() + btn.Text;
- txtValue.Select(++i + m, 0);
- }
- private void btnClean_Click(object sender, EventArgs e)
- {
- txtValue.Text = "";
- }
- private void btnLeft_Click(object sender, EventArgs e)
- {
- int i = txtValue.SelectionStart;
- txtValue.Focus();
- if (i > 0)
- txtValue.Select(--i, 0);
- }
- private void btnRight_Click(object sender, EventArgs e)
- {
- int i = txtValue.SelectionStart;
- txtValue.Focus();
- if (i < txtValue.Text.Trim().Length)
- txtValue.Select(++i, 0);
- }
- private void btnBack_Click(object sender, EventArgs e)
- {
- int i = txtValue.SelectionStart;
- txtValue.Focus();
- if (i > 0)
- {
- txtValue.Text = txtValue.Text.Trim().Substring(0, i - 1) + txtValue.Text.Trim().Substring(i);
- txtValue.Select(--i, 0);
- }
- }
- private void btnSubmit_Click(object sender, EventArgs e)
- {
- strValue = txtValue.Text.Trim();
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
- private void frmPhNo_Load(object sender, EventArgs e)
- {
- }
- }
- }
|