#pragma once


namespace Layout_Dimensionierung {

	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>
	/// Zusammenfassung für Form1
	///
	/// Warnung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie auch
	///          die Ressourcendateiname-Eigenschaft für das Tool zur Kompilierung verwalteter 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 ref class Form1 : public System::Windows::Forms::Form
	{
   private:
      int aktBild;
      array<Image^>^ bilder;
      const int MAXBILD;

	public:
      Form1(void) : MAXBILD(1)
		{
			InitializeComponent();
			//
			//TODO: Konstruktorcode hier hinzufügen.
			//
         bilder = gcnew array<Image^>(MAXBILD+1);
         bilder[0] = Image::FromFile(".\\images\\Schottland_01.jpg");
         bilder[1] = Image::FromFile(".\\images\\Schottland_02.jpg");
         aktBild = 0;
         pictureBox1->Image = bilder[aktBild];
		}

	protected:
		/// <summary>
		/// Verwendete Ressourcen bereinigen.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
   private: System::Windows::Forms::TabControl^  tabControl1;
   protected: 
   private: System::Windows::Forms::TabPage^  tabPage1;
   private: System::Windows::Forms::TabPage^  tabPage2;
   private: System::Windows::Forms::Button^  button1;
   private: System::Windows::Forms::Label^  label2;
   private: System::Windows::Forms::Label^  label1;
   private: System::Windows::Forms::Button^  btn_vor;

   private: System::Windows::Forms::PictureBox^  pictureBox1;
   private: System::Windows::Forms::Button^  btn_zurueck;


   private: System::ComponentModel::IContainer^  components;

    protected: 




	private:
		/// <summary>
		/// Erforderliche Designervariable.
		/// </summary>


#pragma region Windows Form Designer generated code
		/// <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->tabControl1 = (gcnew System::Windows::Forms::TabControl());
         this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
         this->button1 = (gcnew System::Windows::Forms::Button());
         this->label2 = (gcnew System::Windows::Forms::Label());
         this->label1 = (gcnew System::Windows::Forms::Label());
         this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
         this->btn_vor = (gcnew System::Windows::Forms::Button());
         this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
         this->btn_zurueck = (gcnew System::Windows::Forms::Button());
         this->tabControl1->SuspendLayout();
         this->tabPage1->SuspendLayout();
         this->tabPage2->SuspendLayout();
         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->BeginInit();
         this->SuspendLayout();
         // 
         // tabControl1
         // 
         this->tabControl1->Controls->Add(this->tabPage1);
         this->tabControl1->Controls->Add(this->tabPage2);
         this->tabControl1->Dock = System::Windows::Forms::DockStyle::Fill;
         this->tabControl1->Location = System::Drawing::Point(0, 0);
         this->tabControl1->Name = L"tabControl1";
         this->tabControl1->SelectedIndex = 0;
         this->tabControl1->Size = System::Drawing::Size(429, 195);
         this->tabControl1->TabIndex = 0;
         // 
         // tabPage1
         // 
         this->tabPage1->Controls->Add(this->button1);
         this->tabPage1->Controls->Add(this->label2);
         this->tabPage1->Controls->Add(this->label1);
         this->tabPage1->Location = System::Drawing::Point(4, 22);
         this->tabPage1->Name = L"tabPage1";
         this->tabPage1->Padding = System::Windows::Forms::Padding(3);
         this->tabPage1->Size = System::Drawing::Size(421, 169);
         this->tabPage1->TabIndex = 0;
         this->tabPage1->Text = L"AutoSize";
         this->tabPage1->UseVisualStyleBackColor = true;
         // 
         // button1
         // 
         this->button1->Location = System::Drawing::Point(198, 120);
         this->button1->Name = L"button1";
         this->button1->Size = System::Drawing::Size(130, 23);
         this->button1->TabIndex = 5;
         this->button1->Text = L"Text verlängern";
         this->button1->UseVisualStyleBackColor = true;
         this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
         // 
         // label2
         // 
         this->label2->AutoEllipsis = true;
         this->label2->Location = System::Drawing::Point(93, 53);
         this->label2->Name = L"label2";
         this->label2->Size = System::Drawing::Size(149, 23);
         this->label2->TabIndex = 4;
         this->label2->Text = L"Dies ist ein AutoEllipse-Label.";
         // 
         // label1
         // 
         this->label1->AutoSize = true;
         this->label1->Location = System::Drawing::Point(93, 25);
         this->label1->Name = L"label1";
         this->label1->Size = System::Drawing::Size(135, 13);
         this->label1->TabIndex = 3;
         this->label1->Text = L"Dies ist ein AutoSize-Label.";
         // 
         // tabPage2
         // 
         this->tabPage2->Controls->Add(this->btn_vor);
         this->tabPage2->Controls->Add(this->pictureBox1);
         this->tabPage2->Controls->Add(this->btn_zurueck);
         this->tabPage2->Location = System::Drawing::Point(4, 22);
         this->tabPage2->Name = L"tabPage2";
         this->tabPage2->Padding = System::Windows::Forms::Padding(50, 30, 50, 30);
         this->tabPage2->Size = System::Drawing::Size(421, 169);
         this->tabPage2->TabIndex = 1;
         this->tabPage2->Text = L"Padding";
         this->tabPage2->UseVisualStyleBackColor = true;
         // 
         // btn_vor
         // 
         this->btn_vor->Dock = System::Windows::Forms::DockStyle::Right;
         this->btn_vor->Location = System::Drawing::Point(296, 30);
         this->btn_vor->Name = L"btn_vor";
         this->btn_vor->Size = System::Drawing::Size(75, 109);
         this->btn_vor->TabIndex = 2;
         this->btn_vor->Text = L">";
         this->btn_vor->UseVisualStyleBackColor = true;
         this->btn_vor->Click += gcnew System::EventHandler(this, &Form1::btn_vor_Click);
         // 
         // pictureBox1
         // 
         this->pictureBox1->Dock = System::Windows::Forms::DockStyle::Fill;
         this->pictureBox1->Location = System::Drawing::Point(125, 30);
         this->pictureBox1->Name = L"pictureBox1";
         this->pictureBox1->Size = System::Drawing::Size(246, 109);
         this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
         this->pictureBox1->TabIndex = 1;
         this->pictureBox1->TabStop = false;
         // 
         // btn_zurueck
         // 
         this->btn_zurueck->Dock = System::Windows::Forms::DockStyle::Left;
         this->btn_zurueck->Location = System::Drawing::Point(50, 30);
         this->btn_zurueck->Name = L"btn_zurueck";
         this->btn_zurueck->Size = System::Drawing::Size(75, 109);
         this->btn_zurueck->TabIndex = 0;
         this->btn_zurueck->Text = L"<";
         this->btn_zurueck->UseVisualStyleBackColor = true;
         this->btn_zurueck->Click += gcnew System::EventHandler(this, &Form1::btn_zurueck_Click);
         // 
         // Form1
         // 
         this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
         this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
         this->ClientSize = System::Drawing::Size(429, 195);
         this->Controls->Add(this->tabControl1);
         this->Name = L"Form1";
         this->Text = L"Angepasste Dimensionierung";
         this->tabControl1->ResumeLayout(false);
         this->tabPage1->ResumeLayout(false);
         this->tabPage1->PerformLayout();
         this->tabPage2->ResumeLayout(false);
         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->EndInit();
         this->ResumeLayout(false);

      }
#pragma endregion
    private: 
       
       void button1_Click(Object^  sender, EventArgs^  e) 
       {
           label1->Text += " Es passt seine Größe an den Inhalt an.";
           label2->Text += " Es kürzt zu große Inhalte mit ... ab.";
       }


       void btn_zurueck_Click(Object^  sender, EventArgs^  e) 
       {
          if (aktBild > 0)
          {
             aktBild--;
             pictureBox1->Image = bilder[aktBild];
          }
       }
       void btn_vor_Click(Object^  sender, EventArgs^  e) 
       {
          if (aktBild < MAXBILD)
          {
             aktBild++;
             pictureBox1->Image = bilder[aktBild];
          }
       }
};
}

