שאלה ב c++ visual studio gui
שלום לכולם!!!
יש לי gui שבניתי :
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "iomanip"
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <fstream>
namespace anicegame {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:
ata;
using namespace System:
rawing;
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
////////////// my code is here
int c;
int billy[9];
int danny[9];
for (int i=0; i<9; i++)
billy = i;
for (int j=0; j<9; j++) {
int d;
c = rand() % (9-j) + 1;
danny[j] = billy[c];
d = billy[8-j];
billy[8-j] = billy[c];
billy[c] = d;
}
/////////////////////
label1->Text = L"1";
label2->Text = L"2";
label3->Text = L"3";
label4->Text = L"4";
label5->Text = L"5";
label6->Text = L"6";
label7->Text = L"7";
label8->Text = L"8";
label9->Text = L"9";
}
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::Label^ label7;
private: System::Windows::Forms::Label^ label8;
private: System::Windows::Forms::Label^ label9;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button6;
private: System::Windows::Forms::Button^ button7;
private: System::Windows::Forms::Button^ button8;
private: System::Windows::Forms::Button^ button9;
private: System::Windows::Forms::Button^ button10;
private: System::Windows::Forms::Button^ button11;
private: System::Windows::Forms::Button^ button12;
private: System::Windows::Forms::Button^ button13;
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)
{
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->label7 = (gcnew System::Windows::Forms::Label());
this->label8 = (gcnew System::Windows::Forms::Label());
this->label9 = (gcnew System::Windows::Forms::Label());
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->button6 = (gcnew System::Windows::Forms::Button());
this->button7 = (gcnew System::Windows::Forms::Button());
this->button8 = (gcnew System::Windows::Forms::Button());
this->button9 = (gcnew System::Windows::Forms::Button());
this->button10 = (gcnew System::Windows::Forms::Button());
this->button11 = (gcnew System::Windows::Forms::Button());
this->button12 = (gcnew System::Windows::Forms::Button());
this->button13 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System:
rawing:
oint(93, 77);
this->label1->Name = L"label1";
this->label1->Size = System:
rawing::Size(35, 13);
this->label1->TabIndex = 0;
this->label1->Text = L"label1";
this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System:
rawing:
oint(134, 77);
this->label2->Name = L"label2";
this->label2->Size = System:
rawing::Size(35, 13);
this->label2->TabIndex = 1;
this->label2->Text = L"label2";
this->label2->Click += gcnew System::EventHandler(this, &Form1::label2_Click);
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System:
rawing:
oint(175, 77);
this->label3->Name = L"label3";
this->label3->Size = System:
rawing::Size(35, 13);
this->label3->TabIndex = 2;
this->label3->Text = L"label3";
this->label3->Click += gcnew System::EventHandler(this, &Form1::label3_Click);
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System:
rawing:
oint(93, 99);
this->label4->Name = L"label4";
this->label4->Size = System:
rawing::Size(35, 13);
this->label4->TabIndex = 3;
this->label4->Text = L"label4";
this->label4->Click += gcnew System::EventHandler(this, &Form1::label4_Click);
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System:
rawing:
oint(134, 99);
this->label5->Name = L"label5";
this->label5->Size = System:
rawing::Size(35, 13);
this->label5->TabIndex = 4;
this->label5->Text = L"label5";
this->label5->Click += gcnew System::EventHandler(this, &Form1::label5_Click);
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System:
rawing:
oint(175, 99);
this->label6->Name = L"label6";
this->label6->Size = System:
rawing::Size(35, 13);
שלום לכולם!!!
יש לי gui שבניתי :
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "iomanip"
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <fstream>
namespace anicegame {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System:
using namespace System:
/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
////////////// my code is here
int c;
int billy[9];
int danny[9];
for (int i=0; i<9; i++)
billy = i;
for (int j=0; j<9; j++) {
int d;
c = rand() % (9-j) + 1;
danny[j] = billy[c];
d = billy[8-j];
billy[8-j] = billy[c];
billy[c] = d;
}
/////////////////////
label1->Text = L"1";
label2->Text = L"2";
label3->Text = L"3";
label4->Text = L"4";
label5->Text = L"5";
label6->Text = L"6";
label7->Text = L"7";
label8->Text = L"8";
label9->Text = L"9";
}
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::Label^ label7;
private: System::Windows::Forms::Label^ label8;
private: System::Windows::Forms::Label^ label9;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button6;
private: System::Windows::Forms::Button^ button7;
private: System::Windows::Forms::Button^ button8;
private: System::Windows::Forms::Button^ button9;
private: System::Windows::Forms::Button^ button10;
private: System::Windows::Forms::Button^ button11;
private: System::Windows::Forms::Button^ button12;
private: System::Windows::Forms::Button^ button13;
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)
{
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->label7 = (gcnew System::Windows::Forms::Label());
this->label8 = (gcnew System::Windows::Forms::Label());
this->label9 = (gcnew System::Windows::Forms::Label());
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->button6 = (gcnew System::Windows::Forms::Button());
this->button7 = (gcnew System::Windows::Forms::Button());
this->button8 = (gcnew System::Windows::Forms::Button());
this->button9 = (gcnew System::Windows::Forms::Button());
this->button10 = (gcnew System::Windows::Forms::Button());
this->button11 = (gcnew System::Windows::Forms::Button());
this->button12 = (gcnew System::Windows::Forms::Button());
this->button13 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System:
this->label1->Name = L"label1";
this->label1->Size = System:
this->label1->TabIndex = 0;
this->label1->Text = L"label1";
this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System:
this->label2->Name = L"label2";
this->label2->Size = System:
this->label2->TabIndex = 1;
this->label2->Text = L"label2";
this->label2->Click += gcnew System::EventHandler(this, &Form1::label2_Click);
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System:
this->label3->Name = L"label3";
this->label3->Size = System:
this->label3->TabIndex = 2;
this->label3->Text = L"label3";
this->label3->Click += gcnew System::EventHandler(this, &Form1::label3_Click);
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System:
this->label4->Name = L"label4";
this->label4->Size = System:
this->label4->TabIndex = 3;
this->label4->Text = L"label4";
this->label4->Click += gcnew System::EventHandler(this, &Form1::label4_Click);
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System:
this->label5->Name = L"label5";
this->label5->Size = System:
this->label5->TabIndex = 4;
this->label5->Text = L"label5";
this->label5->Click += gcnew System::EventHandler(this, &Form1::label5_Click);
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System:
this->label6->Name = L"label6";
this->label6->Size = System: