?
Ich hoffe das der Quellcode jetzt besser zu lesen ist
#pragma once
#include <windows.h>
#include <iostream>
namespace ProgrammControl
{
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 std;
/// <summary>
/// Zusammenfassung für Form1
///
/// Achtung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie die Eigenschaft
/// 'Ressourcendateiname' für das Compilertool für verwaltete Ressourcen ändern,
/// das allen .resx-Dateien zugewiesen ist, von denen diese Klasse abhängt.
/// Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
/// arbeiten, die diesem Formular zugewiesen sind.
/// </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::Button * button1;
private: System::Windows::Forms::Button * button2;
private: System::Windows::Forms::GroupBox * groupBox1;
private: System::Windows::Forms::CheckBox * checkBox1;
private: System::Windows::Forms::CheckBox * checkBox2;
private: System::Windows::Forms::CheckBox * checkBox3;
private: System::Windows::Forms::CheckBox * checkBox4;
private: System::Windows::Forms::CheckBox * checkBox5;
private: System::Windows::Forms::Label * label1;
private: System::Windows::Forms::CheckBox * checkBox6;
private: System::Windows::Forms::CheckBox * checkBox7;
private:
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
System::ComponentModel::Container * components;
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
void InitializeComponent(void)
{
this->button1 = new System::Windows::Forms::Button();
this->button2 = new System::Windows::Forms::Button();
this->groupBox1 = new System::Windows::Forms::GroupBox();
this->checkBox1 = new System::Windows::Forms::CheckBox();
this->checkBox2 = new System::Windows::Forms::CheckBox();
this->checkBox3 = new System::Windows::Forms::CheckBox();
this->checkBox4 = new System::Windows::Forms::CheckBox();
this->checkBox5 = new System::Windows::Forms::CheckBox();
this->label1 = new System::Windows::Forms::Label();
this->checkBox6 = new System::Windows::Forms::CheckBox();
this->checkBox7 = new System::Windows::Forms::CheckBox();
this->groupBox1->SuspendLayout();
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(24, 312);
this->button1->Name = S"button1";
this->button1->Size = System::Drawing::Size(120, 32);
this->button1->TabIndex = 0;
this->button1->Text = S"button1";
this->button1->Click += new System::EventHandler(this, button1_Click);
//
// button2
//
this->button2->Location = System::Drawing::Point(320, 312);
this->button2->Name = S"button2";
this->button2->Size = System::Drawing::Size(120, 32);
this->button2->TabIndex = 2;
this->button2->Text = S"button2";
this->button2->Click += new System::EventHandler(this, button2_Click);
//
// groupBox1
//
this->groupBox1->Controls->Add(this->checkBox1);
this->groupBox1->Controls->Add(this->checkBox2);
this->groupBox1->Controls->Add(this->checkBox3);
this->groupBox1->Controls->Add(this->checkBox4);
this->groupBox1->Controls->Add(this->checkBox5);
this->groupBox1->Controls->Add(this->checkBox6);
this->groupBox1->Controls->Add(this->checkBox7);
this->groupBox1->Location = System::Drawing::Point(16, 64);
this->groupBox1->Name = S"groupBox1";
this->groupBox1->Size = System::Drawing::Size(424, 192);
this->groupBox1->TabIndex = 3;
this->groupBox1->TabStop = false;
this->groupBox1->Text = S"groupBox1";
//
// checkBox1
//
this->checkBox1->Location = System::Drawing::Point(24, 32);
this->checkBox1->Name = S"checkBox1";
this->checkBox1->Size = System::Drawing::Size(80, 24);
this->checkBox1->TabIndex = 0;
this->checkBox1->Text = S"checkBox1";
//
// checkBox2
//
this->checkBox2->Location = System::Drawing::Point(24, 72);
this->checkBox2->Name = S"checkBox2";
this->checkBox2->Size = System::Drawing::Size(80, 24);
this->checkBox2->TabIndex = 0;
this->checkBox2->Text = S"checkBox1";
//
// checkBox3
//
this->checkBox3->Location = System::Drawing::Point(24, 112);
this->checkBox3->Name = S"checkBox3";
this->checkBox3->Size = System::Drawing::Size(80, 24);
this->checkBox3->TabIndex = 0;
this->checkBox3->Text = S"checkBox1";
//
// checkBox4
//
this->checkBox4->Location = System::Drawing::Point(24, 152);
this->checkBox4->Name = S"checkBox4";
this->checkBox4->Size = System::Drawing::Size(80, 24);
this->checkBox4->TabIndex = 0;
this->checkBox4->Text = S"checkBox1";
//
// checkBox5
//
this->checkBox5->Location = System::Drawing::Point(208, 32);
this->checkBox5->Name = S"checkBox5";
this->checkBox5->Size = System::Drawing::Size(128, 24);
this->checkBox5->TabIndex = 0;
this->checkBox5->Text = S"checkBox1";
//
// label1
//
this->label1->Location = System::Drawing::Point(16, 16);
this->label1->Name = S"label1";
this->label1->Size = System::Drawing::Size(304, 24);
this->label1->TabIndex = 4;
this->label1->Text = S"label1";
//
// checkBox6
//
this->checkBox6->Location = System::Drawing::Point(208, 72);
this->checkBox6->Name = S"checkBox6";
this->checkBox6->Size = System::Drawing::Size(128, 24);
this->checkBox6->TabIndex = 0;
this->checkBox6->Text = S"checkBox1";
//
// checkBox7
//
this->checkBox7->Location = System::Drawing::Point(208, 112);
this->checkBox7->Name = S"checkBox7";
this->checkBox7->Size = System::Drawing::Size(128, 24);
this->checkBox7->TabIndex = 0;
this->checkBox7->Text = S"checkBox1";
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
this->ClientSize = System::Drawing::Size(456, 365);
this->Controls->Add(this->label1);
this->Controls->Add(this->groupBox1);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Name = S"Form1";
this->Load += new System::EventHandler(this, Form1_Load);
this->groupBox1->ResumeLayout(false);
this->ResumeLayout(false);
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
// Messagebox ausgeben
this->label1->Text = "Programm wird beendet";
MessageBox(NULL,TEXT("Programm wird beendet"),TEXT("Bitte warten"),0);
// Programm beenden
Form1::Close();
}
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
{
if(this->checkBox1->Checked == true)
{
ShellExecute(0, "open", "WINWORD.EXE",0, 0, SW_SHOWNORMAL);
}
}
private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e)
{
// Objekte beschriften
this->Form1::Text = "Programm starten";
this->label1->Text = "Bitte wählen Sie das Programm das gestartet werden soll";
this->button1->Text = "Beenden";
this->button2->Text = "Ausführen";
this->groupBox1->Text = "Programm auswählen";
this->checkBox1->Text = "Word";
this->checkBox2->Text = "Excel";
this->checkBox3->Text = "Paint";
this->checkBox4->Text = "Phase5";
this->checkBox5->Text = "PC Herunterfahren";
this->checkBox6->Text = "PC Neustarten";
this->checkBox7->Text = "Abmelden";
// Setzen der Fensterfarbe
Form1::set_BackColor(System::Drawing::Color::AliceBlue);
}
};
}