| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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 OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
- {
- public partial class frmInitializeLengthAndWidthRectangle : Form
- {
- public double length { get; set;}
- public double width { get; set; }
- public frmInitializeLengthAndWidthRectangle()
- {
- InitializeComponent();
- }
- private void btn_ok_Click(object sender, EventArgs e)
- {
- double dlength = 0;double dwidth = 0;
- if(double.TryParse(tB_length.Text,out dlength)&& double.TryParse(tB_width.Text, out dwidth))
- {
- length = dlength;
- width = dwidth;
- }
- else
- {
- MessageBox.Show("Please enter the correct numeric format!");
- this.DialogResult= DialogResult.None;
- return;
- }
- this.DialogResult = DialogResult.OK;
- }
- private void btn_cannel_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.Cancel;
- this.Close();
- }
- }
- }
|