Şimdi Ara

C++ ile Form Applications Form3 den Form1 e YARDIM

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
3 Misafir (1 Mobil) - 2 Masaüstü1 Mobil
5 sn
1
Cevap
0
Favori
381
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Arkadaşlar Form1 den Form2 ye yada Form2 den Form3 e geçebiliyorum. Aynı şekilde Form3 den Form2 ye Form2 den Form1 e geçebiliyorum.Ancak Form3 den Form1 e geçemiyorum. Yani bir form geri gelebilirken 2 form geri gidemiyorum. Bu konuda yardım eder misiniz.İstediğim şey Form 3 deki Anasayfa butonuna tıklandıktan sonra Form1 e geçmek. İşte Kodlar:

    FORM1 İN KODLARI

    #pragma once 
    #include "stdAfx.h"
    #include "Form2.h"


    namespace adasda {

    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::Button^ button1;
    protected:

    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->button1 = (gcnew System::Windows::Forms::Button());
    this->SuspendLayout();
    //
    // button1
    //
    this->button1->Location = System::Drawing::Point(82, 83);
    this->button1->Name = L"button1";
    this->button1->Size = System::Drawing::Size(126, 79);
    this->button1->TabIndex = 0;
    this->button1->Text = L"Giriş";
    this->button1->UseVisualStyleBackColor = true;
    this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
    //
    // Form1
    //
    this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    this->ClientSize = System::Drawing::Size(284, 261);
    this->ControlBox = false;
    this->Controls->Add(this->button1);
    this->Name = L"Form1";
    this->Text = L"Form1";
    this->ResumeLayout(false);

    }
    #pragma endregion
    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    Form2^ frm2=gcnew Form2(this);
    frm2->Show();
    this->Hide();
    }
    };
    }



    FORM2 NİN KODLARI

    #pragma once 
    #include "stdAfx.h"
    #include "Form3.h"
    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;


    namespace adasda {

    /// <summary>
    /// Summary for Form2
    ///
    /// 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 Form2 : public System::Windows::Forms::Form
    {
    private: System::Windows::Forms::Form^ Form1;
    public:
    Form2(System::Windows::Forms::Form^ d)
    {
    Form1 = d;
    InitializeComponent();
    //
    //TODO: Add the constructor code here
    //
    }

    protected:
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    ~Form2()
    {
    if (components)
    {
    delete components;
    }
    }
    private: System::Windows::Forms::Button^ button1;
    private: System::Windows::Forms::Button^ button2;
    private: System::Windows::Forms::Button^ button3;
    protected:

    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->button1 = (gcnew System::Windows::Forms::Button());
    this->button2 = (gcnew System::Windows::Forms::Button());
    this->button3 = (gcnew System::Windows::Forms::Button());
    this->SuspendLayout();
    //
    // button1
    //
    this->button1->Location = System::Drawing::Point(69, 97);
    this->button1->Name = L"button1";
    this->button1->Size = System::Drawing::Size(147, 59);
    this->button1->TabIndex = 0;
    this->button1->Text = L"Geri Gİt";
    this->button1->UseVisualStyleBackColor = true;
    this->button1->Click += gcnew System::EventHandler(this, &Form2::button1_Click);
    //
    // button2
    //
    this->button2->Location = System::Drawing::Point(69, 181);
    this->button2->Name = L"button2";
    this->button2->Size = System::Drawing::Size(147, 58);
    this->button2->TabIndex = 1;
    this->button2->Text = L"Çık";
    this->button2->UseVisualStyleBackColor = true;
    this->button2->Click += gcnew System::EventHandler(this, &Form2::button2_Click);
    //
    // button3
    //
    this->button3->Location = System::Drawing::Point(69, 12);
    this->button3->Name = L"button3";
    this->button3->Size = System::Drawing::Size(147, 59);
    this->button3->TabIndex = 2;
    this->button3->Text = L"İleri";
    this->button3->UseVisualStyleBackColor = true;
    this->button3->Click += gcnew System::EventHandler(this, &Form2::button3_Click);
    //
    // Form2
    //
    this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    this->ClientSize = System::Drawing::Size(284, 261);
    this->ControlBox = false;
    this->Controls->Add(this->button3);
    this->Controls->Add(this->button2);
    this->Controls->Add(this->button1);
    this->Name = L"Form2";
    this->Text = L"Form2";
    this->ResumeLayout(false);

    }
    #pragma endregion
    private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
    Application::Exit();
    }
    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    this->Hide();
    Form1->Show();
    }
    private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
    Form3^ frm3=gcnew Form3(this);
    frm3->Show();
    this->Hide();
    }
    };
    }


    FORM3 ÜN KODLARI

    #pragma once 

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;


    namespace adasda {

    /// <summary>
    /// Summary for Form3
    ///
    /// 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 Form3 : public System::Windows::Forms::Form
    {
    private: System::Windows::Forms::Form^ Form2;
    public:
    Form3(System::Windows::Forms::Form^ d)
    { Form2=d;
    InitializeComponent();
    //
    //TODO: Add the constructor code here
    //
    }

    protected:
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    ~Form3()
    {
    if (components)
    {
    delete components;
    }
    }
    private: System::Windows::Forms::Button^ button1;
    public: System::Windows::Forms::Button^ button2;
    private:

    protected:

    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->button1 = (gcnew System::Windows::Forms::Button());
    this->button2 = (gcnew System::Windows::Forms::Button());
    this->SuspendLayout();
    //
    // button1
    //
    this->button1->Location = System::Drawing::Point(79, 43);
    this->button1->Name = L"button1";
    this->button1->Size = System::Drawing::Size(123, 54);
    this->button1->TabIndex = 0;
    this->button1->Text = L"Geri Git";
    this->button1->UseVisualStyleBackColor = true;
    this->button1->Click += gcnew System::EventHandler(this, &Form3::button1_Click);
    //
    // button2
    //
    this->button2->Location = System::Drawing::Point(79, 125);
    this->button2->Name = L"button2";
    this->button2->Size = System::Drawing::Size(123, 54);
    this->button2->TabIndex = 1;
    this->button2->Text = L"AnaSayfa";
    this->button2->UseVisualStyleBackColor = true;
    this->button2->Click += gcnew System::EventHandler(this, &Form3::button2_Click);
    //
    // Form3
    //
    this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    this->ClientSize = System::Drawing::Size(284, 261);
    this->ControlBox = false;
    this->Controls->Add(this->button2);
    this->Controls->Add(this->button1);
    this->Name = L"Form3";
    this->Text = L"Form3";
    this->ResumeLayout(false);

    }
    #pragma endregion
    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    this->Hide();
    Form2->Show();
    }
    private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {


    }
    };
    }







  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.