#pragma once
#pragma comment (lib,"winmm.lib")
#include <windows.h>
namespace LottoMixx {
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>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ label1;
protected:
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::StatusStrip^ statusStrip1;
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->label6 = (gcnew System::Windows::Forms::Label());
this->button1 = (gcnew System::Windows::Forms::Button());
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->statusStrip1->SuspendLayout();
this->SuspendLayout();
//
// label1
//
this->label1->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->label1->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->label1->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label1->Location = System::Drawing::Point(12, 9);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(35, 35);
this->label1->TabIndex = 0;
this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
//
// label2
//
this->label2->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->label2->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->label2->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label2->Location = System::Drawing::Point(53, 9);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(35, 35);
this->label2->TabIndex = 1;
this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
//
// label3
//
this->label3->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->label3->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->label3->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label3->Location = System::Drawing::Point(94, 9);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(35, 35);
this->label3->TabIndex = 2;
this->label3->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
//
// label4
//
this->label4->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->label4->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->label4->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label4->Location = System::Drawing::Point(135, 9);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(35, 35);
this->label4->TabIndex = 3;
this->label4->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
//
// label5
//
this->label5->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->label5->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->label5->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label5->Location = System::Drawing::Point(176, 9);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(35, 35);
this->label5->TabIndex = 4;
this->label5->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
//
// label6
//
this->label6->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->label6->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->label6->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label6->Location = System::Drawing::Point(217, 9);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(35, 35);
this->label6->TabIndex = 5;
this->label6->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
//
// button1
//
this->button1->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->button1->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->button1->Location = System::Drawing::Point(53, 47);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(158, 28);
this->button1->TabIndex = 6;
this->button1->Text = L"OK";
this->button1->UseVisualStyleBackColor = false;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// statusStrip1
//
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->toolStripStatusLabel1});
this->statusStrip1->Location = System::Drawing::Point(0, 78);
this->statusStrip1->Name = L"statusStrip1";
this->statusStrip1->Size = System::Drawing::Size(263, 22);
this->statusStrip1->TabIndex = 7;
this->statusStrip1->Text = L"statusStrip1";
//
// toolStripStatusLabel1
//
this->toolStripStatusLabel1->Font = (gcnew System::Drawing::Font(L"Comic Sans MS", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";
this->toolStripStatusLabel1->Size = System::Drawing::Size(208, 17);
this->toolStripStatusLabel1->Text = L"Copyright (c) 2006 - Cihan Kahraman";
//
// Form1
//
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->ClientSize = System::Drawing::Size(263, 100);
this->Controls->Add(this->statusStrip1);
this->Controls->Add(this->button1);
this->Controls->Add(this->label6);
this->Controls->Add(this->label5);
this->Controls->Add(this->label4);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
this->Name = L"Form1";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"LottoMixx v.2";
this->statusStrip1->ResumeLayout(false);
this->statusStrip1->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
srand(timeGetTime());
int Zufall[6];
Zufall[1]=(rand()%49)+1;
label1->Text=Zufall[1].ToString();
do
{
Zufall[2]=(rand()%49)+1;
label2->Text=Zufall[2].ToString();
}while(Zufall[2]==Zufall[1]);
do
{
Zufall[3]=(rand()%49)+1;
label3->Text=Zufall[3].ToString();
}while(Zufall[3]==Zufall[1]||Zufall[3]==Zufall[2]);
do
{
Zufall[4]=(rand()%49)+1;
label4->Text=Zufall[4].ToString();
}while(Zufall[4]==Zufall[1]||Zufall[4]==Zufall[2]||Zufall[4]==Zufall[3]);
do
{
Zufall[5]=(rand()%49)+1;
label5->Text=Zufall[5].ToString();
}while(Zufall[5]==Zufall[1]||Zufall[5]==Zufall[2]||Zufall[5]==Zufall[3]||Zufall[5]==Zufall[4]);
do
{
Zufall[6]=(rand()%49)+1;
label6->Text=Zufall[6].ToString();
}while(Zufall[6]==Zufall[1]||Zufall[6]==Zufall[2]||Zufall[6]==Zufall[3]||Zufall[6]==Zufall[4]||Zufall[6]==Zufall[5]);
}
};
}