Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #pragma comment(lib,"Winmm.lib")
- namespace CLR2 {
- using namespace System;
- using namespace System::ComponentModel;
- using namespace System::Collections;
- using namespace System::Windows::Forms;
- using namespace System::Data;
- using namespace System::Drawing;
- using namespace System::Reflection;
- using namespace System::Resources;
- using namespace System::Media;
- /// <summary>
- /// Сводка для MyForm
- /// </summary>
- public ref class MyForm : public System::Windows::Forms::Form
- {
- public:
- MyForm(void)
- {
- InitializeComponent();
- //
- //TODO: добавьте код конструктора
- //
- }
- protected:
- /// <summary>
- /// Освободить все используемые ресурсы.
- /// </summary>
- ~MyForm()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::Button^ button1;
- protected:
- private: System::Windows::Forms::Button^ button2;
- private:
- /// <summary>
- /// Обязательная переменная конструктора.
- /// </summary>
- System::ComponentModel::Container ^components;
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Требуемый метод для поддержки конструктора — не изменяйте
- /// содержимое этого метода с помощью редактора кода.
- /// </summary>
- void InitializeComponent(void)
- {
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
- this->button1 = (gcnew System::Windows::Forms::Button());
- this->button2 = (gcnew System::Windows::Forms::Button());
- this->SuspendLayout();
- //
- // button1
- //
- this->button1->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
- this->button1->Location = System::Drawing::Point(489, 63);
- this->button1->Name = L"button1";
- this->button1->Size = System::Drawing::Size(75, 23);
- this->button1->TabIndex = 0;
- this->button1->Text = L"Жми";
- this->button1->UseVisualStyleBackColor = true;
- this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click);
- //
- // button2
- //
- this->button2->Location = System::Drawing::Point(489, 113);
- this->button2->Name = L"button2";
- this->button2->Size = System::Drawing::Size(75, 23);
- this->button2->TabIndex = 1;
- this->button2->Text = L"Не жми";
- this->button2->UseVisualStyleBackColor = true;
- this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click);
- //
- // MyForm
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"$this.BackgroundImage")));
- this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
- this->ClientSize = System::Drawing::Size(598, 551);
- this->Controls->Add(this->button2);
- this->Controls->Add(this->button1);
- this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
- this->Name = L"MyForm";
- this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
- this->Text = L"ROflan";
- this->ResumeLayout(false);
- }
- #pragma endregion
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
- {
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
- this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"Dio")));
- }
- private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e)
- {
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
- this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"Gachi")));
- //System::Media::SoundPlayer^ f;
- //f->Stream = safe_cast<System::IO::Stream^>(resources->GetObject("123"));
- //f->Play();
- Assembly^ assembly = Assembly::GetExecutingAssembly();
- ResourceManager^ rm = gcnew ResourceManager(assembly->GetName()->Name + ".MyForm", assembly);
- SoundPlayer^ player = gcnew SoundPlayer(rm->GetStream("123"));
- player->PlayLooping();
- this->button1->Text = L"Ты";
- this->button2->Text = L"Пипався";
- //this->ClientSize = System::Drawing::Size(598*2, 551*2);
- this->button1->Size = System::Drawing::Size(0, 0);
- this->button2->Size = System::Drawing::Size(0, 0);
- //this->WindowState = System::Windows::Forms::FormWindowState::Maximized;
- this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
- this->WindowState = FormWindowState::Maximized;
- }
- private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement