Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 16.85 KB | None | 0 0
  1. #pragma once
  2. #include <string>
  3.  
  4. namespace srednia {
  5.  
  6.     using namespace System;
  7.     using namespace System::ComponentModel;
  8.     using namespace System::Collections;
  9.     using namespace System::Windows::Forms;
  10.     using namespace System::Data;
  11.     using namespace System::Drawing;
  12.  
  13.    
  14.     /// <summary>
  15.     /// Summary for MyForm
  16.     /// </summary>
  17.     public ref class MyForm : public System::Windows::Forms::Form
  18.     {
  19.     public:
  20.         double A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P;
  21.        
  22.         int ile_liczb = 1;
  23.         double *wskaznik;
  24.         int numer = 1;
  25.         double suma = A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P;
  26.         double wynik = suma / ile_liczb;
  27.         double test = 8;
  28.  
  29.  
  30.         MyForm(void)
  31.         {
  32.             InitializeComponent();
  33.             //
  34.             //TODO: Add the constructor code here
  35.             //
  36.         }
  37.  
  38.     protected:
  39.         /// <summary>
  40.         /// Clean up any resources being used.
  41.         /// </summary>
  42.         ~MyForm()
  43.         {
  44.             if (components)
  45.             {
  46.                 delete components;
  47.             }
  48.         }
  49.     private: System::Windows::Forms::Button^  Ocena1;
  50.     private: System::Windows::Forms::Button^  Ocena3;
  51.     private: System::Windows::Forms::Button^  Ocena4;
  52.     private: System::Windows::Forms::Button^  Ocena5;
  53.     private: System::Windows::Forms::Button^  Ocena6;
  54.     protected:
  55.  
  56.  
  57.  
  58.  
  59.  
  60.     private: System::Windows::Forms::Button^  Ocena2;
  61.     private: System::Windows::Forms::Button^  Ocena15;
  62.     private: System::Windows::Forms::Button^  Ocena25;
  63.     private: System::Windows::Forms::Button^  Ocena35;
  64.     private: System::Windows::Forms::Button^  Ocena45;
  65.     private: System::Windows::Forms::Button^  Ocena55;
  66.     private: System::Windows::Forms::Button^  Poprzedni;
  67.     private: System::Windows::Forms::Button^  Nastepny;
  68.     private: System::Windows::Forms::Label^  r_A;
  69.     private: System::Windows::Forms::Label^  r_B;
  70.     private: System::Windows::Forms::Label^  r_C;
  71.     private: System::Windows::Forms::Label^  r_D;
  72.     private: System::Windows::Forms::Label^  r_E;
  73.     private: System::Windows::Forms::Label^  r_F;
  74.     private: System::Windows::Forms::Label^  r_G;
  75.     private: System::Windows::Forms::Label^  r_H;
  76.     private: System::Windows::Forms::Label^  r_I;
  77.     private: System::Windows::Forms::Label^  r_J;
  78.     private: System::Windows::Forms::Label^  r_K;
  79.     private: System::Windows::Forms::Label^  r_L;
  80.     private: System::Windows::Forms::Label^  r_M;
  81.     private: System::Windows::Forms::Label^  r_N;
  82.     private: System::Windows::Forms::Label^  r_O;
  83.     private: System::Windows::Forms::Label^  r_P;
  84.     private: System::Windows::Forms::Label^  Napis;
  85.     private: System::Windows::Forms::Label^  Wynik;
  86.     private: System::Windows::Forms::Button^  Reset;
  87.     private: System::Windows::Forms::Label^  A_suma;
  88.     private: System::Windows::Forms::Label^  A_ile;
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.     private: System::ComponentModel::IContainer^  components;
  98.  
  99.  
  100.     protected:
  101.  
  102.     private:
  103.         /// <summary>
  104.         /// Required designer variable.
  105.         /// </summary>
  106.  
  107.  
  108. #pragma region Windows Form Designer generated code
  109.         /// <summary>
  110.         /// Required method for Designer support - do not modify
  111.         /// the contents of this method with the code editor.
  112.         /// </summary>
  113.         void InitializeComponent(void)
  114.         {
  115.             System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
  116.             this->Ocena1 = (gcnew System::Windows::Forms::Button());
  117.             this->Ocena2 = (gcnew System::Windows::Forms::Button());
  118.             this->Ocena3 = (gcnew System::Windows::Forms::Button());
  119.             this->Ocena4 = (gcnew System::Windows::Forms::Button());
  120.             this->Ocena5 = (gcnew System::Windows::Forms::Button());
  121.             this->Ocena6 = (gcnew System::Windows::Forms::Button());
  122.             this->Ocena15 = (gcnew System::Windows::Forms::Button());
  123.             this->Ocena25 = (gcnew System::Windows::Forms::Button());
  124.             this->Ocena35 = (gcnew System::Windows::Forms::Button());
  125.             this->Ocena45 = (gcnew System::Windows::Forms::Button());
  126.             this->Ocena55 = (gcnew System::Windows::Forms::Button());
  127.             this->Poprzedni = (gcnew System::Windows::Forms::Button());
  128.             this->Nastepny = (gcnew System::Windows::Forms::Button());
  129.             this->r_A = (gcnew System::Windows::Forms::Label());
  130.             this->r_B = (gcnew System::Windows::Forms::Label());
  131.             this->r_C = (gcnew System::Windows::Forms::Label());
  132.             this->r_D = (gcnew System::Windows::Forms::Label());
  133.             this->r_E = (gcnew System::Windows::Forms::Label());
  134.             this->r_F = (gcnew System::Windows::Forms::Label());
  135.             this->r_G = (gcnew System::Windows::Forms::Label());
  136.             this->r_H = (gcnew System::Windows::Forms::Label());
  137.             this->r_I = (gcnew System::Windows::Forms::Label());
  138.             this->r_J = (gcnew System::Windows::Forms::Label());
  139.             this->r_K = (gcnew System::Windows::Forms::Label());
  140.             this->r_L = (gcnew System::Windows::Forms::Label());
  141.             this->r_M = (gcnew System::Windows::Forms::Label());
  142.             this->r_N = (gcnew System::Windows::Forms::Label());
  143.             this->r_O = (gcnew System::Windows::Forms::Label());
  144.             this->r_P = (gcnew System::Windows::Forms::Label());
  145.             this->Napis = (gcnew System::Windows::Forms::Label());
  146.             this->Wynik = (gcnew System::Windows::Forms::Label());
  147.             this->Reset = (gcnew System::Windows::Forms::Button());
  148.             this->A_suma = (gcnew System::Windows::Forms::Label());
  149.             this->A_ile = (gcnew System::Windows::Forms::Label());
  150.             this->SuspendLayout();
  151.             //
  152.             // Ocena1
  153.             //
  154.             this->Ocena1->Cursor = System::Windows::Forms::Cursors::Hand;
  155.             resources->ApplyResources(this->Ocena1, L"Ocena1");
  156.             this->Ocena1->Name = L"Ocena1";
  157.             this->Ocena1->UseVisualStyleBackColor = true;
  158.             this->Ocena1->Click += gcnew System::EventHandler(this, &MyForm::Ocena1_Click);
  159.             //
  160.             // Ocena2
  161.             //
  162.             this->Ocena2->Cursor = System::Windows::Forms::Cursors::Hand;
  163.             resources->ApplyResources(this->Ocena2, L"Ocena2");
  164.             this->Ocena2->Name = L"Ocena2";
  165.             this->Ocena2->UseVisualStyleBackColor = true;
  166.             //
  167.             // Ocena3
  168.             //
  169.             this->Ocena3->Cursor = System::Windows::Forms::Cursors::Hand;
  170.             resources->ApplyResources(this->Ocena3, L"Ocena3");
  171.             this->Ocena3->Name = L"Ocena3";
  172.             this->Ocena3->UseVisualStyleBackColor = true;
  173.             //
  174.             // Ocena4
  175.             //
  176.             this->Ocena4->Cursor = System::Windows::Forms::Cursors::Hand;
  177.             resources->ApplyResources(this->Ocena4, L"Ocena4");
  178.             this->Ocena4->Name = L"Ocena4";
  179.             this->Ocena4->UseVisualStyleBackColor = true;
  180.             //
  181.             // Ocena5
  182.             //
  183.             this->Ocena5->Cursor = System::Windows::Forms::Cursors::Hand;
  184.             resources->ApplyResources(this->Ocena5, L"Ocena5");
  185.             this->Ocena5->Name = L"Ocena5";
  186.             this->Ocena5->UseVisualStyleBackColor = true;
  187.             //
  188.             // Ocena6
  189.             //
  190.             this->Ocena6->Cursor = System::Windows::Forms::Cursors::Hand;
  191.             resources->ApplyResources(this->Ocena6, L"Ocena6");
  192.             this->Ocena6->Name = L"Ocena6";
  193.             this->Ocena6->UseVisualStyleBackColor = true;
  194.             //
  195.             // Ocena15
  196.             //
  197.             this->Ocena15->Cursor = System::Windows::Forms::Cursors::Hand;
  198.             resources->ApplyResources(this->Ocena15, L"Ocena15");
  199.             this->Ocena15->Name = L"Ocena15";
  200.             this->Ocena15->UseVisualStyleBackColor = true;
  201.             //
  202.             // Ocena25
  203.             //
  204.             this->Ocena25->Cursor = System::Windows::Forms::Cursors::Hand;
  205.             resources->ApplyResources(this->Ocena25, L"Ocena25");
  206.             this->Ocena25->Name = L"Ocena25";
  207.             this->Ocena25->UseVisualStyleBackColor = true;
  208.             //
  209.             // Ocena35
  210.             //
  211.             this->Ocena35->Cursor = System::Windows::Forms::Cursors::Hand;
  212.             resources->ApplyResources(this->Ocena35, L"Ocena35");
  213.             this->Ocena35->Name = L"Ocena35";
  214.             this->Ocena35->UseVisualStyleBackColor = true;
  215.             //
  216.             // Ocena45
  217.             //
  218.             this->Ocena45->Cursor = System::Windows::Forms::Cursors::Hand;
  219.             resources->ApplyResources(this->Ocena45, L"Ocena45");
  220.             this->Ocena45->Name = L"Ocena45";
  221.             this->Ocena45->UseVisualStyleBackColor = true;
  222.             //
  223.             // Ocena55
  224.             //
  225.             this->Ocena55->Cursor = System::Windows::Forms::Cursors::Hand;
  226.             resources->ApplyResources(this->Ocena55, L"Ocena55");
  227.             this->Ocena55->Name = L"Ocena55";
  228.             this->Ocena55->UseVisualStyleBackColor = true;
  229.             //
  230.             // Poprzedni
  231.             //
  232.             resources->ApplyResources(this->Poprzedni, L"Poprzedni");
  233.             this->Poprzedni->Name = L"Poprzedni";
  234.             this->Poprzedni->UseVisualStyleBackColor = true;
  235.             //
  236.             // Nastepny
  237.             //
  238.             resources->ApplyResources(this->Nastepny, L"Nastepny");
  239.             this->Nastepny->Name = L"Nastepny";
  240.             this->Nastepny->UseVisualStyleBackColor = true;
  241.             //
  242.             // r_A
  243.             //
  244.             this->r_A->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  245.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  246.             resources->ApplyResources(this->r_A, L"r_A");
  247.             this->r_A->Name = L"r_A";
  248.             //
  249.             // r_B
  250.             //
  251.             this->r_B->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  252.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  253.             resources->ApplyResources(this->r_B, L"r_B");
  254.             this->r_B->Name = L"r_B";
  255.             //
  256.             // r_C
  257.             //
  258.             this->r_C->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  259.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  260.             resources->ApplyResources(this->r_C, L"r_C");
  261.             this->r_C->Name = L"r_C";
  262.             //
  263.             // r_D
  264.             //
  265.             this->r_D->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  266.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  267.             resources->ApplyResources(this->r_D, L"r_D");
  268.             this->r_D->Name = L"r_D";
  269.             //
  270.             // r_E
  271.             //
  272.             this->r_E->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  273.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  274.             resources->ApplyResources(this->r_E, L"r_E");
  275.             this->r_E->Name = L"r_E";
  276.             //
  277.             // r_F
  278.             //
  279.             this->r_F->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  280.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  281.             resources->ApplyResources(this->r_F, L"r_F");
  282.             this->r_F->Name = L"r_F";
  283.             //
  284.             // r_G
  285.             //
  286.             this->r_G->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  287.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  288.             resources->ApplyResources(this->r_G, L"r_G");
  289.             this->r_G->Name = L"r_G";
  290.             //
  291.             // r_H
  292.             //
  293.             this->r_H->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  294.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  295.             resources->ApplyResources(this->r_H, L"r_H");
  296.             this->r_H->Name = L"r_H";
  297.             //
  298.             // r_I
  299.             //
  300.             this->r_I->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  301.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  302.             resources->ApplyResources(this->r_I, L"r_I");
  303.             this->r_I->Name = L"r_I";
  304.             //
  305.             // r_J
  306.             //
  307.             this->r_J->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  308.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  309.             resources->ApplyResources(this->r_J, L"r_J");
  310.             this->r_J->Name = L"r_J";
  311.             //
  312.             // r_K
  313.             //
  314.             this->r_K->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  315.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  316.             resources->ApplyResources(this->r_K, L"r_K");
  317.             this->r_K->Name = L"r_K";
  318.             //
  319.             // r_L
  320.             //
  321.             this->r_L->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  322.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  323.             resources->ApplyResources(this->r_L, L"r_L");
  324.             this->r_L->Name = L"r_L";
  325.             //
  326.             // r_M
  327.             //
  328.             this->r_M->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  329.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  330.             resources->ApplyResources(this->r_M, L"r_M");
  331.             this->r_M->Name = L"r_M";
  332.             //
  333.             // r_N
  334.             //
  335.             this->r_N->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  336.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  337.             resources->ApplyResources(this->r_N, L"r_N");
  338.             this->r_N->Name = L"r_N";
  339.             //
  340.             // r_O
  341.             //
  342.             this->r_O->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  343.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  344.             resources->ApplyResources(this->r_O, L"r_O");
  345.             this->r_O->Name = L"r_O";
  346.             //
  347.             // r_P
  348.             //
  349.             this->r_P->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
  350.                 static_cast<System::Int32>(static_cast<System::Byte>(0)));
  351.             resources->ApplyResources(this->r_P, L"r_P");
  352.             this->r_P->Name = L"r_P";
  353.             //
  354.             // Napis
  355.             //
  356.             resources->ApplyResources(this->Napis, L"Napis");
  357.             this->Napis->ForeColor = System::Drawing::Color::OrangeRed;
  358.             this->Napis->Name = L"Napis";
  359.             //
  360.             // Wynik
  361.             //
  362.             resources->ApplyResources(this->Wynik, L"Wynik");
  363.             this->Wynik->Name = L"Wynik";
  364.             //
  365.             // Reset
  366.             //
  367.             resources->ApplyResources(this->Reset, L"Reset");
  368.             this->Reset->Name = L"Reset";
  369.             this->Reset->UseVisualStyleBackColor = true;
  370.             //
  371.             // A_suma
  372.             //
  373.             resources->ApplyResources(this->A_suma, L"A_suma");
  374.             this->A_suma->ForeColor = System::Drawing::Color::DarkOrange;
  375.             this->A_suma->Name = L"A_suma";
  376.             this->A_suma->Click += gcnew System::EventHandler(this, &MyForm::A_suma_Click);
  377.             //
  378.             // A_ile
  379.             //
  380.             resources->ApplyResources(this->A_ile, L"A_ile");
  381.             this->A_ile->ForeColor = System::Drawing::Color::DarkOrange;
  382.             this->A_ile->Name = L"A_ile";
  383.             //
  384.             // MyForm
  385.             //
  386.             resources->ApplyResources(this, L"$this");
  387.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  388.             this->BackColor = System::Drawing::SystemColors::HotTrack;
  389.             this->Controls->Add(this->A_ile);
  390.             this->Controls->Add(this->A_suma);
  391.             this->Controls->Add(this->Reset);
  392.             this->Controls->Add(this->Wynik);
  393.             this->Controls->Add(this->Napis);
  394.             this->Controls->Add(this->r_P);
  395.             this->Controls->Add(this->r_O);
  396.             this->Controls->Add(this->r_N);
  397.             this->Controls->Add(this->r_M);
  398.             this->Controls->Add(this->r_L);
  399.             this->Controls->Add(this->r_K);
  400.             this->Controls->Add(this->r_J);
  401.             this->Controls->Add(this->r_I);
  402.             this->Controls->Add(this->r_H);
  403.             this->Controls->Add(this->r_G);
  404.             this->Controls->Add(this->r_F);
  405.             this->Controls->Add(this->r_E);
  406.             this->Controls->Add(this->r_D);
  407.             this->Controls->Add(this->r_C);
  408.             this->Controls->Add(this->r_B);
  409.             this->Controls->Add(this->r_A);
  410.             this->Controls->Add(this->Nastepny);
  411.             this->Controls->Add(this->Poprzedni);
  412.             this->Controls->Add(this->Ocena55);
  413.             this->Controls->Add(this->Ocena45);
  414.             this->Controls->Add(this->Ocena35);
  415.             this->Controls->Add(this->Ocena25);
  416.             this->Controls->Add(this->Ocena15);
  417.             this->Controls->Add(this->Ocena6);
  418.             this->Controls->Add(this->Ocena5);
  419.             this->Controls->Add(this->Ocena4);
  420.             this->Controls->Add(this->Ocena3);
  421.             this->Controls->Add(this->Ocena2);
  422.             this->Controls->Add(this->Ocena1);
  423.             this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
  424.             this->MaximizeBox = false;
  425.             this->Name = L"MyForm";
  426.             this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
  427.             this->ResumeLayout(false);
  428.  
  429.         }
  430. #pragma endregion
  431.        
  432.     private: System::Void MyForm_Load(System::Object^  sender, System::EventArgs^  e) {
  433.        
  434.         Wynik->Text = Convert::ToString(wynik);
  435.         A_suma->Text = Convert::ToString(suma);
  436.         A_ile->Text = Convert::ToString(ile_liczb);
  437.         *wskaznik = &A;
  438.  
  439.        
  440.     }
  441.              
  442.     private: System::Void A_suma_Click(System::Object^  sender, System::EventArgs^  e) {
  443.     }
  444. private: System::Void Wynik_TextChanged(System::Object^  sender, System::EventArgs^  e) {
  445. }
  446. private: System::Void Ocena1_Click(System::Object^  sender, System::EventArgs^  e) {
  447.     Wynik->Text = Convert::ToString(test);
  448. }
  449. };
  450. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement