Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.99 KB | None | 0 0
  1. #pragma once
  2. #pragma comment(lib,"Winmm.lib")
  3. namespace CLR2 {
  4.  
  5.     using namespace System;
  6.     using namespace System::ComponentModel;
  7.     using namespace System::Collections;
  8.     using namespace System::Windows::Forms;
  9.     using namespace System::Data;
  10.     using namespace System::Drawing;
  11.     using namespace System::Reflection;
  12.     using namespace System::Resources;
  13.     using namespace System::Media;
  14.  
  15.     /// <summary>
  16.     /// Сводка для MyForm
  17.     /// </summary>
  18.  
  19.  
  20.  
  21.     public ref class MyForm : public System::Windows::Forms::Form
  22.     {
  23.     public:
  24.         MyForm(void)
  25.         {
  26.             InitializeComponent();
  27.             //
  28.             //TODO: добавьте код конструктора
  29.             //
  30.         }
  31.  
  32.     protected:
  33.         /// <summary>
  34.         /// Освободить все используемые ресурсы.
  35.         /// </summary>
  36.         ~MyForm()
  37.         {
  38.             if (components)
  39.             {
  40.                 delete components;
  41.             }
  42.         }
  43.     private: System::Windows::Forms::Button^ button1;
  44.     protected:
  45.     private: System::Windows::Forms::Button^ button2;
  46.  
  47.  
  48.  
  49.  
  50.     private:
  51.         /// <summary>
  52.         /// Обязательная переменная конструктора.
  53.         /// </summary>
  54.         System::ComponentModel::Container ^components;
  55.  
  56. #pragma region Windows Form Designer generated code
  57.         /// <summary>
  58.         /// Требуемый метод для поддержки конструктора — не изменяйте
  59.         /// содержимое этого метода с помощью редактора кода.
  60.         /// </summary>
  61.         void InitializeComponent(void)
  62.         {
  63.             System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
  64.             this->button1 = (gcnew System::Windows::Forms::Button());
  65.             this->button2 = (gcnew System::Windows::Forms::Button());
  66.             this->SuspendLayout();
  67.             //
  68.             // button1
  69.             //
  70.             this->button1->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
  71.             this->button1->Location = System::Drawing::Point(489, 63);
  72.             this->button1->Name = L"button1";
  73.             this->button1->Size = System::Drawing::Size(75, 23);
  74.             this->button1->TabIndex = 0;
  75.             this->button1->Text = L"Жми";
  76.             this->button1->UseVisualStyleBackColor = true;
  77.             this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click);
  78.             //
  79.             // button2
  80.             //
  81.             this->button2->Location = System::Drawing::Point(489, 113);
  82.             this->button2->Name = L"button2";
  83.             this->button2->Size = System::Drawing::Size(75, 23);
  84.             this->button2->TabIndex = 1;
  85.             this->button2->Text = L"Не жми";
  86.             this->button2->UseVisualStyleBackColor = true;
  87.             this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click);
  88.             //
  89.             // MyForm
  90.             //
  91.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  92.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  93.             this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"$this.BackgroundImage")));
  94.             this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
  95.             this->ClientSize = System::Drawing::Size(598, 551);
  96.             this->Controls->Add(this->button2);
  97.             this->Controls->Add(this->button1);
  98.             this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
  99.             this->Name = L"MyForm";
  100.             this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
  101.             this->Text = L"ROflan";
  102.             this->ResumeLayout(false);
  103.  
  104.         }
  105. #pragma endregion
  106.     private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
  107.     {
  108.         System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
  109.         this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"Dio")));
  110.  
  111.  
  112.     }
  113.     private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e)
  114.     {
  115.  
  116.         System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
  117.  
  118.  
  119.         this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"Gachi")));
  120.  
  121.  
  122.         //System::Media::SoundPlayer^ f;
  123.         //f->Stream = safe_cast<System::IO::Stream^>(resources->GetObject("123"));
  124.         //f->Play();
  125.  
  126.  
  127.         Assembly^ assembly = Assembly::GetExecutingAssembly();
  128.  
  129.         ResourceManager^ rm = gcnew ResourceManager(assembly->GetName()->Name + ".MyForm", assembly);
  130.  
  131.         SoundPlayer^ player = gcnew SoundPlayer(rm->GetStream("123"));
  132.         player->PlayLooping();
  133.  
  134.         this->button1->Text = L"Ты";
  135.         this->button2->Text = L"Пипався";
  136.         //this->ClientSize = System::Drawing::Size(598*2, 551*2);
  137.  
  138.         this->button1->Size = System::Drawing::Size(0, 0);
  139.         this->button2->Size = System::Drawing::Size(0, 0);
  140.         //this->WindowState = System::Windows::Forms::FormWindowState::Maximized;
  141.         this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
  142.         this->WindowState = FormWindowState::Maximized;
  143.  
  144.     }
  145.  
  146.  
  147. private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {
  148. }
  149. };
  150. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement