Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

Rekomendowane odpowiedzi

Opublikowano

Jak w temacie. Dam załącznik.

 

Dodam że jestem zielony w tym całym C++

 

Jest to kalkulator. Robiłem go 2-3 godziny

 

KOD:

 

 

#pragma once

namespace Kalkulator {

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>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
	Form1(void)
	{
		InitializeComponent();
		//
		//TODO: Add the constructor code here
		//
	}

protected:
	/// <summary>
	/// Clean up any resources being used.
	/// </summary>
	~Form1()
	{
		if (components)
		{
			delete components;
		}
	}
private: System::Windows::Forms::TextBox^  textBox1;
protected:

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::GroupBox^  groupBox1;



private: System::Windows::Forms::TextBox^  textBox2;









private: System::Windows::Forms::Button^  button24;
private: System::Windows::Forms::Button^  button23;
private: System::Windows::Forms::Button^  button22;
private: System::Windows::Forms::Button^  button21;
private: System::Windows::Forms::TextBox^  textBox3;
private: System::Windows::Forms::Button^  button20;
private: System::Windows::Forms::Button^  button19;
private: System::Windows::Forms::Button^  button16;
private: System::Windows::Forms::Button^  button13;
private: System::Windows::Forms::Button^  button18;
private: System::Windows::Forms::Button^  button15;
private: System::Windows::Forms::Button^  button12;
private: System::Windows::Forms::Button^  button17;
private: System::Windows::Forms::Button^  button14;
private: System::Windows::Forms::Button^  button11;
private: System::Windows::Forms::Button^  button25;
private: System::Windows::Forms::Button^  button26;
private: System::Windows::Forms::MenuStrip^  menuStrip1;
private: System::Windows::Forms::ToolStripMenuItem^  plikToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^  oProgramieToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^  autorzyToolStripMenuItem;

private: System::Windows::Forms::TextBox^  textBox4;
private: System::Windows::Forms::Button^  button27;
private: System::Windows::Forms::Button^  button28;
private: System::Windows::Forms::Button^  button29;



private:
	/// <summary>
	/// Required designer variable.
	/// </summary>
	System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
	/// <summary>
	/// Required method for Designer support - do not modify
	/// the contents of this method with the code editor.
	/// </summary>
	void InitializeComponent(void)
	{
		this->textBox1 = (gcnew System::Windows::Forms::TextBox());
		this->button1 = (gcnew System::Windows::Forms::Button());
		this->button2 = (gcnew System::Windows::Forms::Button());
		this->button3 = (gcnew System::Windows::Forms::Button());
		this->button4 = (gcnew System::Windows::Forms::Button());
		this->button5 = (gcnew System::Windows::Forms::Button());
		this->button6 = (gcnew System::Windows::Forms::Button());
		this->button7 = (gcnew System::Windows::Forms::Button());
		this->button8 = (gcnew System::Windows::Forms::Button());
		this->button9 = (gcnew System::Windows::Forms::Button());
		this->button10 = (gcnew System::Windows::Forms::Button());
		this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
		this->textBox4 = (gcnew System::Windows::Forms::TextBox());
		this->button29 = (gcnew System::Windows::Forms::Button());
		this->textBox3 = (gcnew System::Windows::Forms::TextBox());
		this->button28 = (gcnew System::Windows::Forms::Button());
		this->button27 = (gcnew System::Windows::Forms::Button());
		this->button11 = (gcnew System::Windows::Forms::Button());
		this->button26 = (gcnew System::Windows::Forms::Button());
		this->button24 = (gcnew System::Windows::Forms::Button());
		this->button20 = (gcnew System::Windows::Forms::Button());
		this->button19 = (gcnew System::Windows::Forms::Button());
		this->textBox2 = (gcnew System::Windows::Forms::TextBox());
		this->button25 = (gcnew System::Windows::Forms::Button());
		this->button16 = (gcnew System::Windows::Forms::Button());
		this->button23 = (gcnew System::Windows::Forms::Button());
		this->button13 = (gcnew System::Windows::Forms::Button());
		this->button18 = (gcnew System::Windows::Forms::Button());
		this->button22 = (gcnew System::Windows::Forms::Button());
		this->button14 = (gcnew System::Windows::Forms::Button());
		this->button21 = (gcnew System::Windows::Forms::Button());
		this->button15 = (gcnew System::Windows::Forms::Button());
		this->button17 = (gcnew System::Windows::Forms::Button());
		this->button12 = (gcnew System::Windows::Forms::Button());
		this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
		this->plikToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
		this->oProgramieToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
		this->autorzyToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
		this->groupBox1->SuspendLayout();
		this->menuStrip1->SuspendLayout();
		this->SuspendLayout();
		//
		// textBox1
		//
		this->textBox1->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->textBox1->Location = System::Drawing::Point(15, 26);
		this->textBox1->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->textBox1->Name = L"textBox1";
		this->textBox1->ReadOnly = true;
		this->textBox1->Size = System::Drawing::Size(111, 27);
		this->textBox1->TabIndex = 0;
		this->textBox1->Text = L"0";
		//
		// button1
		//
		this->button1->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button1->Location = System::Drawing::Point(14, 62);
		this->button1->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button1->Name = L"button1";
		this->button1->Size = System::Drawing::Size(33, 34);
		this->button1->TabIndex = 2;
		this->button1->Text = L"1";
		this->button1->UseVisualStyleBackColor = false;
		this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
		//
		// button2
		//
		this->button2->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button2->Location = System::Drawing::Point(52, 61);
		this->button2->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button2->Name = L"button2";
		this->button2->Size = System::Drawing::Size(33, 34);
		this->button2->TabIndex = 2;
		this->button2->Text = L"2";
		this->button2->UseVisualStyleBackColor = false;
		this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
		//
		// button3
		//
		this->button3->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button3->Location = System::Drawing::Point(92, 61);
		this->button3->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button3->Name = L"button3";
		this->button3->Size = System::Drawing::Size(33, 34);
		this->button3->TabIndex = 2;
		this->button3->Text = L"3";
		this->button3->UseVisualStyleBackColor = false;
		this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
		//
		// button4
		//
		this->button4->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button4->Location = System::Drawing::Point(13, 104);
		this->button4->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button4->Name = L"button4";
		this->button4->Size = System::Drawing::Size(33, 34);
		this->button4->TabIndex = 2;
		this->button4->Text = L"4";
		this->button4->UseVisualStyleBackColor = false;
		this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
		//
		// button5
		//
		this->button5->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button5->Location = System::Drawing::Point(52, 104);
		this->button5->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button5->Name = L"button5";
		this->button5->Size = System::Drawing::Size(33, 34);
		this->button5->TabIndex = 2;
		this->button5->Text = L"5";
		this->button5->UseVisualStyleBackColor = false;
		this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
		//
		// button6
		//
		this->button6->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button6->Location = System::Drawing::Point(92, 104);
		this->button6->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button6->Name = L"button6";
		this->button6->Size = System::Drawing::Size(33, 34);
		this->button6->TabIndex = 2;
		this->button6->Text = L"6";
		this->button6->UseVisualStyleBackColor = false;
		this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
		//
		// button7
		//
		this->button7->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button7->Location = System::Drawing::Point(13, 146);
		this->button7->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button7->Name = L"button7";
		this->button7->Size = System::Drawing::Size(33, 34);
		this->button7->TabIndex = 2;
		this->button7->Text = L"7";
		this->button7->UseVisualStyleBackColor = false;
		this->button7->Click += gcnew System::EventHandler(this, &Form1::button7_Click);
		//
		// button8
		//
		this->button8->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button8->Location = System::Drawing::Point(52, 146);
		this->button8->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button8->Name = L"button8";
		this->button8->Size = System::Drawing::Size(33, 34);
		this->button8->TabIndex = 2;
		this->button8->Text = L"8";
		this->button8->UseVisualStyleBackColor = false;
		this->button8->Click += gcnew System::EventHandler(this, &Form1::button8_Click);
		//
		// button9
		//
		this->button9->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button9->Location = System::Drawing::Point(92, 146);
		this->button9->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button9->Name = L"button9";
		this->button9->Size = System::Drawing::Size(33, 34);
		this->button9->TabIndex = 2;
		this->button9->Text = L"9";
		this->button9->UseVisualStyleBackColor = false;
		this->button9->Click += gcnew System::EventHandler(this, &Form1::button9_Click);
		//
		// button10
		//
		this->button10->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button10->Location = System::Drawing::Point(14, 188);
		this->button10->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button10->Name = L"button10";
		this->button10->Size = System::Drawing::Size(32, 34);
		this->button10->TabIndex = 2;
		this->button10->Text = L"0";
		this->button10->UseVisualStyleBackColor = false;
		this->button10->Click += gcnew System::EventHandler(this, &Form1::button10_Click);
		//
		// groupBox1
		//
		this->groupBox1->Controls->Add(this->textBox4);
		this->groupBox1->Controls->Add(this->button29);
		this->groupBox1->Controls->Add(this->textBox3);
		this->groupBox1->Controls->Add(this->button28);
		this->groupBox1->Controls->Add(this->button27);
		this->groupBox1->Controls->Add(this->button11);
		this->groupBox1->Controls->Add(this->button1);
		this->groupBox1->Controls->Add(this->button26);
		this->groupBox1->Controls->Add(this->button24);
		this->groupBox1->Controls->Add(this->button20);
		this->groupBox1->Controls->Add(this->button19);
		this->groupBox1->Controls->Add(this->textBox2);
		this->groupBox1->Controls->Add(this->button25);
		this->groupBox1->Controls->Add(this->button16);
		this->groupBox1->Controls->Add(this->button23);
		this->groupBox1->Controls->Add(this->button5);
		this->groupBox1->Controls->Add(this->button13);
		this->groupBox1->Controls->Add(this->button10);
		this->groupBox1->Controls->Add(this->button18);
		this->groupBox1->Controls->Add(this->button22);
		this->groupBox1->Controls->Add(this->button14);
		this->groupBox1->Controls->Add(this->button21);
		this->groupBox1->Controls->Add(this->button15);
		this->groupBox1->Controls->Add(this->textBox1);
		this->groupBox1->Controls->Add(this->button17);
		this->groupBox1->Controls->Add(this->button9);
		this->groupBox1->Controls->Add(this->button12);
		this->groupBox1->Controls->Add(this->button6);
		this->groupBox1->Controls->Add(this->button4);
		this->groupBox1->Controls->Add(this->button3);
		this->groupBox1->Controls->Add(this->button7);
		this->groupBox1->Controls->Add(this->button8);
		this->groupBox1->Controls->Add(this->button2);
		this->groupBox1->Location = System::Drawing::Point(0, 29);
		this->groupBox1->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->groupBox1->Name = L"groupBox1";
		this->groupBox1->Padding = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->groupBox1->Size = System::Drawing::Size(201, 259);
		this->groupBox1->TabIndex = 3;
		this->groupBox1->TabStop = false;
		this->groupBox1->Enter += gcnew System::EventHandler(this, &Form1::groupBox1_Enter);
		//
		// textBox4
		//
		this->textBox4->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->textBox4->Location = System::Drawing::Point(132, 27);
		this->textBox4->Name = L"textBox4";
		this->textBox4->ReadOnly = true;
		this->textBox4->Size = System::Drawing::Size(22, 27);
		this->textBox4->TabIndex = 6;
		//
		// button29
		//
		this->button29->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button29->Location = System::Drawing::Point(169, 12);
		this->button29->Name = L"button29";
		this->button29->Size = System::Drawing::Size(27, 210);
		this->button29->TabIndex = 5;
		this->button29->Text = L"W\r\ny\r\nz\r\ne\r\nr\r\nu\r\nj";
		this->button29->UseVisualStyleBackColor = false;
		this->button29->Visible = false;
		this->button29->Click += gcnew System::EventHandler(this, &Form1::button29_Click);
		//
		// textBox3
		//
		this->textBox3->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->textBox3->Location = System::Drawing::Point(6, 229);
		this->textBox3->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->textBox3->Name = L"textBox3";
		this->textBox3->ReadOnly = true;
		this->textBox3->Size = System::Drawing::Size(189, 27);
		this->textBox3->TabIndex = 0;
		//
		// button28
		//
		this->button28->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button28->Location = System::Drawing::Point(169, 12);
		this->button28->Name = L"button28";
		this->button28->Size = System::Drawing::Size(27, 210);
		this->button28->TabIndex = 5;
		this->button28->Text = L"W\r\ny\r\nz\r\ne\r\nr\r\nu\r\nj";
		this->button28->UseVisualStyleBackColor = false;
		this->button28->Click += gcnew System::EventHandler(this, &Form1::button28_Click);
		//
		// button27
		//
		this->button27->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button27->Enabled = false;
		this->button27->Location = System::Drawing::Point(92, 188);
		this->button27->Name = L"button27";
		this->button27->Size = System::Drawing::Size(32, 34);
		this->button27->TabIndex = 4;
		this->button27->Text = L"=";
		this->button27->UseVisualStyleBackColor = false;
		this->button27->Click += gcnew System::EventHandler(this, &Form1::button27_Click);
		//
		// button11
		//
		this->button11->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button11->Location = System::Drawing::Point(14, 62);
		this->button11->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button11->Name = L"button11";
		this->button11->Size = System::Drawing::Size(33, 34);
		this->button11->TabIndex = 1;
		this->button11->Text = L"1";
		this->button11->UseVisualStyleBackColor = false;
		this->button11->Visible = false;
		this->button11->Click += gcnew System::EventHandler(this, &Form1::button11_Click);
		//
		// button26
		//
		this->button26->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button26->Location = System::Drawing::Point(52, 189);
		this->button26->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button26->Name = L"button26";
		this->button26->Size = System::Drawing::Size(33, 32);
		this->button26->TabIndex = 3;
		this->button26->Text = L"CE";
		this->button26->UseVisualStyleBackColor = false;
		this->button26->Visible = false;
		this->button26->Click += gcnew System::EventHandler(this, &Form1::button26_Click);
		//
		// button24
		//
		this->button24->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button24->Location = System::Drawing::Point(131, 190);
		this->button24->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button24->Name = L"button24";
		this->button24->Size = System::Drawing::Size(32, 32);
		this->button24->TabIndex = 1;
		this->button24->Text = L"/";
		this->button24->UseVisualStyleBackColor = false;
		this->button24->Click += gcnew System::EventHandler(this, &Form1::button24_Click);
		//
		// button20
		//
		this->button20->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button20->Location = System::Drawing::Point(15, 189);
		this->button20->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button20->Name = L"button20";
		this->button20->Size = System::Drawing::Size(33, 32);
		this->button20->TabIndex = 1;
		this->button20->Text = L"0";
		this->button20->UseVisualStyleBackColor = false;
		this->button20->Visible = false;
		this->button20->Click += gcnew System::EventHandler(this, &Form1::button20_Click);
		//
		// button19
		//
		this->button19->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button19->Location = System::Drawing::Point(93, 146);
		this->button19->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button19->Name = L"button19";
		this->button19->Size = System::Drawing::Size(33, 34);
		this->button19->TabIndex = 1;
		this->button19->Text = L"9";
		this->button19->UseVisualStyleBackColor = false;
		this->button19->Visible = false;
		this->button19->Click += gcnew System::EventHandler(this, &Form1::button19_Click);
		//
		// textBox2
		//
		this->textBox2->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->textBox2->Location = System::Drawing::Point(15, 26);
		this->textBox2->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->textBox2->Name = L"textBox2";
		this->textBox2->ReadOnly = true;
		this->textBox2->Size = System::Drawing::Size(111, 27);
		this->textBox2->TabIndex = 0;
		this->textBox2->Text = L"0";
		this->textBox2->Visible = false;
		//
		// button25
		//
		this->button25->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button25->Location = System::Drawing::Point(52, 188);
		this->button25->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button25->Name = L"button25";
		this->button25->Size = System::Drawing::Size(33, 34);
		this->button25->TabIndex = 3;
		this->button25->Text = L"CE";
		this->button25->UseVisualStyleBackColor = false;
		this->button25->Click += gcnew System::EventHandler(this, &Form1::button25_Click);
		//
		// button16
		//
		this->button16->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button16->Location = System::Drawing::Point(93, 104);
		this->button16->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button16->Name = L"button16";
		this->button16->Size = System::Drawing::Size(33, 34);
		this->button16->TabIndex = 1;
		this->button16->Text = L"6";
		this->button16->UseVisualStyleBackColor = false;
		this->button16->Visible = false;
		this->button16->Click += gcnew System::EventHandler(this, &Form1::button16_Click);
		//
		// button23
		//
		this->button23->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button23->Location = System::Drawing::Point(131, 146);
		this->button23->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button23->Name = L"button23";
		this->button23->Size = System::Drawing::Size(31, 34);
		this->button23->TabIndex = 1;
		this->button23->Text = L"*";
		this->button23->UseVisualStyleBackColor = false;
		this->button23->Click += gcnew System::EventHandler(this, &Form1::button23_Click);
		//
		// button13
		//
		this->button13->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button13->Location = System::Drawing::Point(92, 61);
		this->button13->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button13->Name = L"button13";
		this->button13->Size = System::Drawing::Size(33, 34);
		this->button13->TabIndex = 1;
		this->button13->Text = L"3";
		this->button13->UseVisualStyleBackColor = false;
		this->button13->Visible = false;
		this->button13->Click += gcnew System::EventHandler(this, &Form1::button13_Click);
		//
		// button18
		//
		this->button18->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button18->Location = System::Drawing::Point(53, 146);
		this->button18->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button18->Name = L"button18";
		this->button18->Size = System::Drawing::Size(33, 34);
		this->button18->TabIndex = 1;
		this->button18->Text = L"8";
		this->button18->UseVisualStyleBackColor = false;
		this->button18->Visible = false;
		this->button18->Click += gcnew System::EventHandler(this, &Form1::button18_Click);
		//
		// button22
		//
		this->button22->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button22->Location = System::Drawing::Point(131, 104);
		this->button22->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button22->Name = L"button22";
		this->button22->Size = System::Drawing::Size(32, 34);
		this->button22->TabIndex = 1;
		this->button22->Text = L"-";
		this->button22->UseVisualStyleBackColor = false;
		this->button22->Click += gcnew System::EventHandler(this, &Form1::button22_Click);
		//
		// button14
		//
		this->button14->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button14->Location = System::Drawing::Point(14, 104);
		this->button14->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button14->Name = L"button14";
		this->button14->Size = System::Drawing::Size(33, 34);
		this->button14->TabIndex = 1;
		this->button14->Text = L"4";
		this->button14->UseVisualStyleBackColor = false;
		this->button14->Visible = false;
		this->button14->Click += gcnew System::EventHandler(this, &Form1::button14_Click);
		//
		// button21
		//
		this->button21->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button21->Location = System::Drawing::Point(131, 61);
		this->button21->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button21->Name = L"button21";
		this->button21->Size = System::Drawing::Size(32, 34);
		this->button21->TabIndex = 1;
		this->button21->Text = L"+";
		this->button21->UseVisualStyleBackColor = false;
		this->button21->Click += gcnew System::EventHandler(this, &Form1::button21_Click);
		//
		// button15
		//
		this->button15->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button15->Location = System::Drawing::Point(53, 104);
		this->button15->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button15->Name = L"button15";
		this->button15->Size = System::Drawing::Size(33, 34);
		this->button15->TabIndex = 1;
		this->button15->Text = L"5";
		this->button15->UseVisualStyleBackColor = false;
		this->button15->Visible = false;
		this->button15->Click += gcnew System::EventHandler(this, &Form1::button15_Click);
		//
		// button17
		//
		this->button17->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button17->Location = System::Drawing::Point(14, 146);
		this->button17->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button17->Name = L"button17";
		this->button17->Size = System::Drawing::Size(33, 34);
		this->button17->TabIndex = 1;
		this->button17->Text = L"7";
		this->button17->UseVisualStyleBackColor = false;
		this->button17->Visible = false;
		this->button17->Click += gcnew System::EventHandler(this, &Form1::button17_Click);
		//
		// button12
		//
		this->button12->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->button12->Location = System::Drawing::Point(53, 61);
		this->button12->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->button12->Name = L"button12";
		this->button12->Size = System::Drawing::Size(33, 34);
		this->button12->TabIndex = 1;
		this->button12->Text = L"2";
		this->button12->UseVisualStyleBackColor = false;
		this->button12->Visible = false;
		this->button12->Click += gcnew System::EventHandler(this, &Form1::button12_Click);
		//
		// menuStrip1
		//
		this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->plikToolStripMenuItem});
		this->menuStrip1->Location = System::Drawing::Point(0, 0);
		this->menuStrip1->Name = L"menuStrip1";
		this->menuStrip1->Padding = System::Windows::Forms::Padding(7, 3, 0, 3);
		this->menuStrip1->Size = System::Drawing::Size(201, 25);
		this->menuStrip1->TabIndex = 5;
		this->menuStrip1->Text = L"menuStrip1";
		//
		// plikToolStripMenuItem
		//
		this->plikToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->oProgramieToolStripMenuItem,
			this->autorzyToolStripMenuItem});
		this->plikToolStripMenuItem->Name = L"plikToolStripMenuItem";
		this->plikToolStripMenuItem->Size = System::Drawing::Size(38, 19);
		this->plikToolStripMenuItem->Text = L"Plik";
		//
		// oProgramieToolStripMenuItem
		//
		this->oProgramieToolStripMenuItem->Name = L"oProgramieToolStripMenuItem";
		this->oProgramieToolStripMenuItem->Size = System::Drawing::Size(140, 22);
		this->oProgramieToolStripMenuItem->Text = L"O programie";
		this->oProgramieToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::oProgramieToolStripMenuItem_Click);
		//
		// autorzyToolStripMenuItem
		//
		this->autorzyToolStripMenuItem->Name = L"autorzyToolStripMenuItem";
		this->autorzyToolStripMenuItem->Size = System::Drawing::Size(140, 22);
		this->autorzyToolStripMenuItem->Text = L"Autorzy";
		this->autorzyToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::autorzyToolStripMenuItem_Click);
		//
		// Form1
		//
		this->AutoScaleDimensions = System::Drawing::SizeF(7, 19);
		this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
		this->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
		this->BackColor = System::Drawing::SystemColors::ActiveCaption;
		this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
		this->ClientSize = System::Drawing::Size(201, 293);
		this->Controls->Add(this->groupBox1);
		this->Controls->Add(this->menuStrip1);
		this->Cursor = System::Windows::Forms::Cursors::Cross;
		this->Font = (gcnew System::Drawing::Font(L"Segoe Print", 8.25F, System::Drawing::FontStyle::Bold));
		this->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
			static_cast<System::Int32>(static_cast<System::Byte>(0)));
		this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
		this->MainMenuStrip = this->menuStrip1;
		this->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
		this->Name = L"Form1";
		this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
		this->Text = L"Kalkulato?";
		this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
		this->groupBox1->ResumeLayout(false);
		this->groupBox1->PerformLayout();
		this->menuStrip1->ResumeLayout(false);
		this->menuStrip1->PerformLayout();
		this->ResumeLayout(false);
		this->PerformLayout();

	}
#pragma endregion
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="1";

		 }
private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="5";

	 }
private: System::Void button10_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0"){
			 textBox1->Text="";
			 MessageBox::Show("Nie można mieć 2 zer obok siebie!","ERROR");
		 }
		 if(textBox1->Text=="00"){
			 textBox1->Text="";
			 MessageBox::Show("Nie można mieć 2 zer obok siebie!","ERROR");
		 }
		 textBox1->Text+="0";

	 }
private: System::Void button9_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="9";

	 }
private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="6";

	 }
private: System::Void button4_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="4";

	 }
private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="3";

	 }
private: System::Void button7_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="7";

	 }
private: System::Void button8_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="8";

	 }
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox1->Text=="0")
			 textBox1->Text="";
		 textBox1->Text+="2";

	 }
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
	 }
private: System::Void button21_Click(System::Object^  sender, System::EventArgs^  e) {
		 button25->Visible=false;
				   		button1->Visible=false;
		 button2->Visible=false;
		 button3->Visible=false;
		 button4->Visible=false;
		 button5->Visible=false;
		 button6->Visible=false;
		 button7->Visible=false;
		 button8->Visible=false;
		 button9->Visible=false;
		 button10->Visible=false;

							button11->Visible=true;
		 button12->Visible=true;
		 button13->Visible=true;
		 button14->Visible=true;
		 button15->Visible=true;
		 button16->Visible=true;
		 button17->Visible=true;
		 button18->Visible=true;
		 button19->Visible=true;
		 button20->Visible=true;
		 button26->Visible=true;
		 button29->Visible=true;
		 button28->Visible=false;



		 button27->Enabled=true;
		 textBox4->Text="+";
		 textBox1->Visible=false;
		 textBox2->Visible=true;
	 }
private: System::Void button22_Click(System::Object^  sender, System::EventArgs^  e) {
		 button25->Visible=false;
				   		button1->Visible=false;
		 button2->Visible=false;
		 button3->Visible=false;
		 button4->Visible=false;
		 button5->Visible=false;
		 button6->Visible=false;
		 button7->Visible=false;
		 button8->Visible=false;
		 button9->Visible=false;
		 button10->Visible=false;

							button11->Visible=true;
		 button12->Visible=true;
		 button13->Visible=true;
		 button14->Visible=true;
		 button15->Visible=true;
		 button16->Visible=true;
		 button17->Visible=true;
		 button18->Visible=true;
		 button19->Visible=true;
		 button20->Visible=true;
		 button26->Visible=true;
		 button29->Visible=true;
		 button28->Visible=false;



		 button27->Enabled=true;
		 textBox4->Text="-";
		 textBox1->Visible=false;
					 textBox2->Visible=true;
	 }
private: System::Void button23_Click(System::Object^  sender, System::EventArgs^  e) {
		 button25->Visible=false;
				   		button1->Visible=false;
		 button2->Visible=false;
		 button3->Visible=false;
		 button4->Visible=false;
		 button5->Visible=false;
		 button6->Visible=false;
		 button7->Visible=false;
		 button8->Visible=false;
		 button9->Visible=false;
		 button10->Visible=false;

							button11->Visible=true;
		 button12->Visible=true;
		 button13->Visible=true;
		 button14->Visible=true;
		 button15->Visible=true;
		 button16->Visible=true;
		 button17->Visible=true;
		 button18->Visible=true;
		 button19->Visible=true;
		 button20->Visible=true;
		 button26->Visible=true;
		 button29->Visible=true;
		 button28->Visible=false;



		 button27->Enabled=true;
		 textBox4->Text="*";
		 textBox1->Visible=false;
					 textBox2->Visible=true;
	 }
private: System::Void button24_Click(System::Object^  sender, System::EventArgs^  e) {	
		 button25->Visible=false;
				   		button1->Visible=false;
		 button2->Visible=false;
		 button3->Visible=false;
		 button4->Visible=false;
		 button5->Visible=false;
		 button6->Visible=false;
		 button7->Visible=false;
		 button8->Visible=false;
		 button9->Visible=false;
		 button10->Visible=false;

							button11->Visible=true;
		 button12->Visible=true;
		 button13->Visible=true;
		 button14->Visible=true;
		 button15->Visible=true;
		 button16->Visible=true;
		 button17->Visible=true;
		 button18->Visible=true;
		 button19->Visible=true;
		 button20->Visible=true;
		 button26->Visible=true;
		 button29->Visible=true;
		 button28->Visible=false;



		 button27->Enabled=true;
		 textBox4->Text="/";
		 textBox1->Visible=false;
					 textBox2->Visible=true;
	 }
private: System::Void button11_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="1";
	 }
private: System::Void button12_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="2";
	 }
private: System::Void button13_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="3";
	 }
private: System::Void button14_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="4";
	 }
private: System::Void button15_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="5";
	 }
private: System::Void button16_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="6";
	 }
private: System::Void button17_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="7";
	 }
private: System::Void button18_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="8";
	 }
private: System::Void button19_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox2->Text=="0")
			 textBox2->Text="";
		 textBox2->Text+="9";
	 }
private: System::Void button20_Click(System::Object^  sender, System::EventArgs^  e) {
					  if(textBox2->Text=="0"){
			 textBox2->Text="";
			 MessageBox::Show("Nie można mieć 2 zer obok siebie!","ERROR");
		 }
		 if(textBox2->Text=="00"){
			 textBox2->Text="";
			 MessageBox::Show("Nie można mieć 2 zer obok siebie!","ERROR");
		 }
		 textBox2->Text+="0";
	 }
private: System::Void button25_Click(System::Object^  sender, System::EventArgs^  e) {
		 textBox4->Text="";
		 button27->Enabled=false;
		 textBox1->Text="0";
		 textBox2->Text="0";
		 textBox1->Visible=true;
		 textBox2->Visible=false;
	 }
private: System::Void button26_Click(System::Object^  sender, System::EventArgs^  e) {
		 button1->Visible=true;
		 button2->Visible=true;
		 button3->Visible=true;
		 button4->Visible=true;
		 button5->Visible=true;
		 button6->Visible=true;
		 button7->Visible=true;
		 button8->Visible=true;
		 button9->Visible=true;
		 button10->Visible=true;
		 button25->Visible=true;
							button11->Visible=false;
		 button12->Visible=false;
		 button13->Visible=false;
		 button14->Visible=false;
		 button15->Visible=false;
		 button16->Visible=false;
		 button17->Visible=false;
		 button18->Visible=false;
		 button19->Visible=false;
		 button20->Visible=false;
		 button26->Visible=false;
		 button29->Visible=false;
		 button28->Visible=true;

		 textBox2->Visible=false;
		 textBox1->Visible=true;
		 textBox2->Text="0";

	 }
private: System::Void oProgramieToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
		 MessageBox::Show("Program Kalkulator\nPewnie ktoś się spyta dlaczego jest zablokowanie pisanie klawiaturą.\nJest to po to, aby uniknąć błędów.\nPewnie jest niedopracowany, ale w przyszłości to naprawie ;D","O programie");
	 }
private: System::Void autorzyToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
		 MessageBox::Show("Program kalkulator stworzył \n \n Deaviss - Stworzenie całokształtu programu","Autorzy");
	 }
private: System::Void groupBox3_Enter(System::Object^  sender, System::EventArgs^  e) {
	 }
private: System::Void groupBox1_Enter(System::Object^  sender, System::EventArgs^  e) {

	 }
private: System::Void kontaktToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
		 MessageBox::Show("Kontakt:\n\n	  \bDamian Męczykowski - [email protected]","Kontakt");
	 }
private: System::Void button27_Click(System::Object^  sender, System::EventArgs^  e) {
		 if(textBox4->Text=="+"){

		 textBox2->Visible=false;

			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")
				 textBox2->Text=="1";  


		 Double x, y;
			 x=Double::Parse(textBox1->Text);
			 y=Double::Parse(textBox2->Text);
			 textBox3->Text=textBox1->Text + " + " + textBox2->Text + "=" + (x+y);


			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")
				 textBox2->Text=="1";  
		 }

		 if(textBox4->Text=="-"){

		 textBox2->Visible=false;

			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")
				 textBox2->Text=="1";  


		 Double x, y;
			 x=Double::Parse(textBox1->Text);
			 y=Double::Parse(textBox2->Text);
			 textBox3->Text=textBox1->Text + " - " + textBox2->Text + "=" + (x-y);


			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")
				 textBox2->Text=="1";  
		 }

		 if(textBox4->Text=="*"){
		 textBox2->Visible=false;

			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")
				 textBox2->Text=="1";  


		 Double x, y;
			 x=Double::Parse(textBox1->Text);
			 y=Double::Parse(textBox2->Text);
			 textBox3->Text=textBox1->Text + " * " + textBox2->Text + "=" + (x*y);


			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")
				 textBox2->Text=="1";  
		 }

		 if(textBox4->Text=="/"){
		 textBox2->Visible=false;

			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")
				 textBox2->Text=="1";  


		 Double x, y;
			 x=Double::Parse(textBox1->Text);
			 y=Double::Parse(textBox2->Text);
			 textBox3->Text=textBox1->Text + " / " + textBox2->Text + "=" + (x/y);//Liczenie


			 if(textBox1->Text=="")
				 textBox1->Text=="1";

			 if(textBox2->Text=="")//Jeśli textbox2 jest równy niczemu
				 textBox2->Text=="1";  //zamień na jeden
		 }

				   		button1->Visible=true;
		 button2->Visible=true;
		 button3->Visible=true;
		 button4->Visible=true;
		 button5->Visible=true;
		 button6->Visible=true;
		 button7->Visible=true;
		 button8->Visible=true;
		 button9->Visible=true;
		 button10->Visible=true;
		 button25->Visible=true;
		 button28->Visible=true;

		 //Widoczność ?

		 //Niewidoczność ?
		 button11->Visible=false;
		 button12->Visible=false;
		 button13->Visible=false;
		 button14->Visible=false;
		 button15->Visible=false;
		 button16->Visible=false;
		 button17->Visible=false;
		 button18->Visible=false;
		 button19->Visible=false;
		 button20->Visible=false;
		 button26->Visible=false;
		 button29->Visible=false;

		 textBox2->Visible=false;
		 textBox1->Visible=true;
					  textBox1->Text="0";
		 textBox2->Text="0";

	 }
private: System::Void button28_Click(System::Object^  sender, System::EventArgs^  e) {
		 textBox1->Visible=true;
		 textBox2->Visible=false;

		 textBox1->Text="0";
	 }
private: System::Void button29_Click(System::Object^  sender, System::EventArgs^  e) {
		 textBox1->Visible=false;
		 textBox2->Visible=true;

		 textBox2->Text="0";
	 }
};
}


 

Edytowane przez Lmfao Baby

sygnatura niezgodna z regulaminem forum mpc rozdział II pkt. 7

Opublikowano
  • Autor

@up

 

Mi działa skan.

 

@x2up

 

Sooource

 

 

Nie dam. Chcę tylko ocene ;D

sygnatura niezgodna z regulaminem forum mpc rozdział II pkt. 7

Opublikowano
  • Autor

@up'y

 

Sry. też mi teraz nie działa.

 

Dam upload i dodam Source.

sygnatura niezgodna z regulaminem forum mpc rozdział II pkt. 7

Opublikowano

No i teraz można oceniać :). Nie znam się za bardzo na okienkach w c++, więc nie oceniam, ale mógłbyś popracować i skrócić kod. Użyj pętli i tablic.

Opublikowano
  • Autor

@up

 

JESTEM ZIELONY.

 

Dążę do wszystkiego swoją pracą.

 

Nie chcę żadnych tzw"JuTube"

 

Jeszcze nie wiem co to tablice i (w Windows Form Application chyba ich nie można użyć ;) )

sygnatura niezgodna z regulaminem forum mpc rozdział II pkt. 7

Opublikowano

To z czego ty się uczysz skoro nie wiesz co to są tablice (dokładniej zmienne tablicowe), a tworzysz aplikacje okienkowe?

Tablice to są podstawy

 

Jeszcze nie wiem co to tablice i (w Windows Form Application chyba ich nie można użyć ;) )

Wszystko co da się zapisać w zmiennej, da się zapisać w zmiennej tablicowej. Można to zrobić w kodzie ręcznie, w aplikacji do tworzenia okienek może nie być takiej opcji.

Opublikowano

Zacznij się najpierw uczyć robić aplikację windows console. :)

Y U NO LEIK MEH?!

TROLOLOLOLLOLOLOLOLOLOL!

Daj +

Opublikowano

@UP, @2UP

Właśnie tak działa Visual C++ (i MSDNowe tutoriale do niego)... Więc to nie wina biednego programisty, że Microsoft ma takie podejście do swoich tutków...

Ta sygnatura jest pusta.

Opublikowano
  • Autor

Posłuchajcie mnie

 

Robiłem kiedyś przez 3 lata w Visual'u Basic

 

To pewnie stąd się znam ;]

sygnatura niezgodna z regulaminem forum mpc rozdział II pkt. 7

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.