使用c#语言编写一个windows窗体应用程序,包括简单的程序界面,能够实现测角交会定点计算,包括: 前方交会 、 后方交会 、 侧方交会 、 距离交会
时间: 2024-01-24 08:17:03 浏览: 121
以下是一个简单的用于测角交会定点计算的 Windows 窗体应用程序示例,它包括前方交会、后方交会、侧方交会和距离交会:
```csharp
using System;
using System.Drawing;
using System.Windows.Forms;
namespace AngleIntersection
{
public partial class MainForm : Form
{
private TextBox textBox1;
private Label label1;
private Label label2;
private TextBox textBox2;
private Label label3;
private TextBox textBox3;
private Label label4;
private TextBox textBox4;
private Label label5;
private TextBox textBox5;
private Label label6;
private TextBox textBox6;
private Label label7;
private TextBox textBox7;
private Label label8;
private TextBox textBox8;
private Button button1;
private Label label9;
private TextBox textBox9;
private Label label10;
private TextBox textBox10;
private Label label11;
private TextBox textBox11;
private Label label12;
private TextBox textBox12;
private Label label13;
private TextBox textBox13;
private Label label14;
private TextBox textBox14;
private Button button2;
private Label label15;
private TextBox textBox15;
private Label label16;
private TextBox textBox16;
private Label label17;
private TextBox textBox17;
private Label label18;
private TextBox textBox18;
private Button button3;
private Label label19;
private TextBox textBox19;
private Label label20;
private TextBox textBox20;
private Label label21;
private TextBox textBox21;
private Label label22;
private TextBox textBox22;
private Button button4;
public MainForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.textBox7 = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.textBox8 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
this.textBox9 = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.textBox10 = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.textBox11 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.textBox12 = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.textBox13 = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.textBox14 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.label15 = new System.Windows.Forms.Label();
this.textBox15 = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
this.textBox16 = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.textBox17 = new System.Windows.Forms.TextBox();
this.label18 = new System.Windows.Forms.Label();
this.textBox18 = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.label19 = new System.Windows.Forms.Label();
this.textBox19 = new System.Windows.Forms.TextBox();
this.label20 = new System.Windows.Forms.Label();
this.textBox20 = new System.Windows.Forms.TextBox();
this.label21 = new System.Windows.Forms.Label();
this.textBox21 = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.textBox22 = new System.Windows.Forms.TextBox();
this.button4 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(96, 26);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 29);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(78, 13);
this.label1.TabIndex = 1;
this.label1.Text = "已知点坐标:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 55);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(78, 13);
this.label2.TabIndex = 3;
this.label2.Text = "已知点坐标:";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(96, 52);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 81);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(78, 13);
this.label3.TabIndex = 5;
this.label3.Text = "已知点坐标:";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(96, 78);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(100, 20);
this.textBox3.TabIndex = 4;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 107);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(78, 13);
this.label4.TabIndex = 7;
this.label4.Text = "已知距离角:";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(96, 104);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(100, 20);
this.textBox4.TabIndex = 6;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 133);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(78, 13);
this.label5.TabIndex = 9;
this.label5.Text = "已知距离角:";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(96, 130);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(100, 20);
this.textBox5.TabIndex = 8;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 159);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(78, 13);
this.label6.TabIndex = 11;
this.label6.Text = "已知距离角:";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(96, 156);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(100, 20);
this.textBox6.TabIndex = 10;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(12, 185);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(78, 13);
this.label7.TabIndex = 13;
this.label7.Text = "已知距离角:";
//
// textBox7
//
this.textBox7.Location = new System.Drawing.Point(96, 182);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(100, 20);
this.textBox7.TabIndex = 12;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 211);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(78, 13);
this.label8.TabIndex = 15;
this.label8.Text = "已知距离角:";
//
// textBox8
//
this.textBox8.Location = new System.Drawing.Point(96, 208);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(100, 20);
this.textBox8.TabIndex = 14;
//
// button1
//
this.button1.Location = new System.Drawing.Point(15, 246);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 16;
this.button1.Text = "前方交会";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(227, 29);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(78, 13);
this.label9.TabIndex = 18;
this.label9.Text = "已知点坐标:";
//
// textBox9
//
this.textBox9.Location = new System.Drawing.Point(311, 26);
this.textBox9.Name = "textBox9";
this.textBox9.Size = new System.Drawing.Size(100, 20);
this.textBox9.TabIndex = 17;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(227, 55);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(78, 13);
this.label10.TabIndex = 20;
this.label10.Text = "已知点坐标:";
//
// textBox10
//
this.textBox10.Location = new System.Drawing.Point(311, 52);
this.textBox10.Name = "textBox10";
this.textBox10.Size = new System.Drawing.Size(100, 20);
this.textBox10.TabIndex = 19;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(227, 81);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(78, 13);
this.label11.TabIndex = 22;
this.label11.Text = "已知点坐标:";
//
// textBox11
//
this.textBox11.Location = new System.Drawing.Point(311, 78);
this.textBox11.Name = "textBox11";
this.textBox11.Size = new System.Drawing.Size(100, 20);
this.textBox11.TabIndex = 21;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(227, 107);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(78, 13);
this.label12.TabIndex = 24;
this.label12.Text = "已知距离角:";
//
// textBox12
//
this.textBox12.Location = new System.Drawing.Point(311, 104);
this.textBox12.Name = "textBox12";
this.textBox12.Size = new System.Drawing.Size(100, 20);
this.textBox12.TabIndex = 23;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(227, 133);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(78, 13);
this.label13.TabIndex = 26;
this.label13.Text = "已知距离角:";
//
// textBox13
//
this.textBox13.Location = new System.Drawing.Point(311, 130);
this.textBox13.Name = "textBox13";
this.textBox13.Size = new System.Drawing.Size(100, 20);
this.textBox13.TabIndex = 25;
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(227, 159);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(78, 13);
this.label14.TabIndex = 28;
this.label14.Text = "已知距离角:";
//
// textBox14
//
this.textBox14.Location = new System.Drawing.Point(311, 156);
this.textBox14.Name = "textBox14";
this.textBox14.Size = new System.Drawing.Size(100, 20);
this.textBox14.TabIndex = 27;
//
// button2
//
this.button2.Location = new System.Drawing.Point(230, 246);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 29;
this.button2.Text = "后方交会";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(444, 29);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(78, 13);
this.label15.TabIndex = 31;
this.label15.Text = "已知点坐标:";
//
// textBox15
//
this.textBox15.Location = new System.Drawing.Point(528, 26);
this.textBox15.Name = "textBox15";
this.textBox15.Size = new System.Drawing.Size(100, 20);
this.textBox15.TabIndex = 30;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(444, 55);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(78, 13);
this.label16.TabIndex = 33;
this.label16.Text = "已知点坐标:";
//
// textBox16
//
this.textBox16.Location = new System.Drawing.Point(528, 52);
this.textBox16.Name = "textBox16";
this.textBox16.Size = new System.Drawing.Size(100, 20);
this.textBox16.TabIndex = 32;
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(444, 81);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(78, 13);
this.label17.TabIndex = 35;
this.label17.Text = "已知距离角:";
//
// textBox17
//
this.textBox17.Location = new System.Drawing.Point(528, 78);
this.textBox17.Name = "textBox17";
this.textBox17.Size = new System.Drawing.Size(100, 20);
this.textBox17.TabIndex = 34;
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(444, 107);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(78, 13);
this.label18.TabIndex = 37;
this.label18.Text = "已知距离角:";
//
// textBox18
//
this.textBox18.Location = new System.Drawing.Point(528, 104);
this.textBox18.Name = "textBox18";
this.textBox18.Size = new System.Drawing.Size(100, 20);
this.textBox18.TabIndex = 36;
//
// button3
//
this.button3.Location = new System.Drawing.Point(447, 246);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 38;
this.button3.Text = "侧方交会";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(227, 185);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(78, 13);
this.label19.TabIndex = 40;
this.label19.Text = "已知距离角:";
//
阅读全文