form1.h

来自「Visual_C++.NET实用编程百例」· C头文件 代码 · 共 525 行 · 第 1/2 页

H
525
字号
#pragma once


namespace counter
{
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary> 
	/// Form1 摘要
	///
	/// 警告: 如果您更改该类的名称,则需要更改 
	///          与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的 
	///          “资源文件名”属性。  否则,
	///          设计器将不能与此窗体关联的
	///          本地化资源正确交互。
	/// </summary>
	
	public __gc class Form1 : public System::Windows::Forms::Form
	{	
	public:
		Form1(void)
		{
			InitializeComponent();
		}
  
	protected:
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::TextBox *  textBox1;
	private: System::Windows::Forms::Button *  button1;
	private: System::Windows::Forms::Button *  button2;
	private: System::Windows::Forms::Button *  button3;
	private: System::Windows::Forms::Button *  button4;
	private: System::Windows::Forms::Button *  button5;
	private: System::Windows::Forms::Button *  button6;
	private: System::Windows::Forms::Button *  button7;
	private: System::Windows::Forms::Button *  button8;
	private: System::Windows::Forms::Button *  button9;
	private: System::Windows::Forms::Button *  button10;
	private: System::Windows::Forms::Button *  button11;
	private: System::Windows::Forms::Button *  button12;
	private: System::Windows::Forms::Button *  button13;
	private: System::Windows::Forms::Button *  button14;
	private: System::Windows::Forms::Button *  button15;
	private: System::Windows::Forms::Button *  button16;
	private: System::Windows::Forms::Button *  button17;
		static double n1 = 0;
		static	 double n2 = 0;
		static	 bool nFlag = true;
		static	 int op = -1;




	private:
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		System::ComponentModel::Container * components;

		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		void InitializeComponent(void)
		{
			this->textBox1 = new System::Windows::Forms::TextBox();
			this->button1 = new System::Windows::Forms::Button();
			this->button2 = new System::Windows::Forms::Button();
			this->button3 = new System::Windows::Forms::Button();
			this->button4 = new System::Windows::Forms::Button();
			this->button5 = new System::Windows::Forms::Button();
			this->button6 = new System::Windows::Forms::Button();
			this->button7 = new System::Windows::Forms::Button();
			this->button8 = new System::Windows::Forms::Button();
			this->button9 = new System::Windows::Forms::Button();
			this->button10 = new System::Windows::Forms::Button();
			this->button11 = new System::Windows::Forms::Button();
			this->button12 = new System::Windows::Forms::Button();
			this->button13 = new System::Windows::Forms::Button();
			this->button14 = new System::Windows::Forms::Button();
			this->button15 = new System::Windows::Forms::Button();
			this->button16 = new System::Windows::Forms::Button();
			this->button17 = new System::Windows::Forms::Button();
			this->SuspendLayout();
			// 
			// textBox1
			// 
			this->textBox1->Location = System::Drawing::Point(40, 24);
			this->textBox1->Name = S"textBox1";
			this->textBox1->Size = System::Drawing::Size(136, 21);
			this->textBox1->TabIndex = 0;
			this->textBox1->Text = S"0.";
			this->textBox1->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(32, 72);
			this->button1->Name = S"button1";
			this->button1->Size = System::Drawing::Size(32, 23);
			this->button1->TabIndex = 1;
			this->button1->Text = S"1";
			this->button1->Click += new System::EventHandler(this, button1_Click);
			// 
			// button2
			// 
			this->button2->Location = System::Drawing::Point(80, 72);
			this->button2->Name = S"button2";
			this->button2->Size = System::Drawing::Size(32, 23);
			this->button2->TabIndex = 2;
			this->button2->Text = S"2";
			this->button2->Click += new System::EventHandler(this, button2_Click);
			// 
			// button3
			// 
			this->button3->Location = System::Drawing::Point(128, 72);
			this->button3->Name = S"button3";
			this->button3->Size = System::Drawing::Size(32, 23);
			this->button3->TabIndex = 3;
			this->button3->Text = S"3";
			this->button3->Click += new System::EventHandler(this, button3_Click);
			// 
			// button4
			// 
			this->button4->Location = System::Drawing::Point(32, 108);
			this->button4->Name = S"button4";
			this->button4->Size = System::Drawing::Size(32, 23);
			this->button4->TabIndex = 6;
			this->button4->Text = S"4";
			this->button4->Click += new System::EventHandler(this, button4_Click);
			// 
			// button5
			// 
			this->button5->Location = System::Drawing::Point(80, 108);
			this->button5->Name = S"button5";
			this->button5->Size = System::Drawing::Size(32, 23);
			this->button5->TabIndex = 5;
			this->button5->Text = S"5";
			this->button5->Click += new System::EventHandler(this, button5_Click);
			// 
			// button6
			// 
			this->button6->Location = System::Drawing::Point(128, 108);
			this->button6->Name = S"button6";
			this->button6->Size = System::Drawing::Size(32, 23);
			this->button6->TabIndex = 4;
			this->button6->Text = S"6";
			this->button6->Click += new System::EventHandler(this, button6_Click);
			// 
			// button7
			// 
			this->button7->Location = System::Drawing::Point(32, 144);
			this->button7->Name = S"button7";
			this->button7->Size = System::Drawing::Size(32, 23);
			this->button7->TabIndex = 9;
			this->button7->Text = S"7";
			this->button7->Click += new System::EventHandler(this, button7_Click);
			// 
			// button8
			// 
			this->button8->Location = System::Drawing::Point(80, 144);
			this->button8->Name = S"button8";
			this->button8->Size = System::Drawing::Size(32, 23);
			this->button8->TabIndex = 8;
			this->button8->Text = S"8";
			this->button8->Click += new System::EventHandler(this, button8_Click);
			// 
			// button9
			// 
			this->button9->Location = System::Drawing::Point(128, 144);
			this->button9->Name = S"button9";
			this->button9->Size = System::Drawing::Size(32, 23);
			this->button9->TabIndex = 7;
			this->button9->Text = S"9";
			this->button9->Click += new System::EventHandler(this, button9_Click);
			// 
			// button10
			// 
			this->button10->Location = System::Drawing::Point(32, 184);
			this->button10->Name = S"button10";
			this->button10->Size = System::Drawing::Size(32, 23);
			this->button10->TabIndex = 10;
			this->button10->Text = S"0";
			this->button10->Click += new System::EventHandler(this, button10_Click);
			// 
			// button11
			// 
			this->button11->Location = System::Drawing::Point(80, 184);
			this->button11->Name = S"button11";
			this->button11->Size = System::Drawing::Size(32, 23);
			this->button11->TabIndex = 13;
			this->button11->Text = S".";
			this->button11->Click += new System::EventHandler(this, button11_Click);
			// 
			// button12
			// 
			this->button12->Location = System::Drawing::Point(128, 184);
			this->button12->Name = S"button12";
			this->button12->Size = System::Drawing::Size(32, 23);
			this->button12->TabIndex = 12;
			this->button12->Text = S"=";
			this->button12->Click += new System::EventHandler(this, button12_Click);
			// 
			// button13
			// 
			this->button13->Location = System::Drawing::Point(176, 72);
			this->button13->Name = S"button13";
			this->button13->Size = System::Drawing::Size(32, 23);
			this->button13->TabIndex = 11;
			this->button13->Text = S"+";
			this->button13->Click += new System::EventHandler(this, button13_Click);
			// 
			// button14
			// 
			this->button14->Location = System::Drawing::Point(176, 108);
			this->button14->Name = S"button14";
			this->button14->Size = System::Drawing::Size(32, 23);
			this->button14->TabIndex = 16;
			this->button14->Text = S"-";
			this->button14->Click += new System::EventHandler(this, button14_Click);
			// 
			// button15
			// 
			this->button15->Location = System::Drawing::Point(176, 144);
			this->button15->Name = S"button15";
			this->button15->Size = System::Drawing::Size(32, 23);
			this->button15->TabIndex = 15;
			this->button15->Text = S"*";
			this->button15->Click += new System::EventHandler(this, button15_Click);
			// 
			// button16
			// 
			this->button16->Location = System::Drawing::Point(176, 184);
			this->button16->Name = S"button16";
			this->button16->Size = System::Drawing::Size(32, 23);
			this->button16->TabIndex = 14;
			this->button16->Text = S"/";
			this->button16->Click += new System::EventHandler(this, button16_Click);
			// 
			// button17
			// 
			this->button17->Location = System::Drawing::Point(192, 24);
			this->button17->Name = S"button17";
			this->button17->Size = System::Drawing::Size(56, 24);
			this->button17->TabIndex = 17;
			this->button17->Text = S"CE";
			this->button17->Click += new System::EventHandler(this, button17_Click);
			// 
			// Form1
			// 
			this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
			this->ClientSize = System::Drawing::Size(272, 230);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?