IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VC++ .NET Discussion :

[Windows Forms]Passer d'une forme à une autre


Sujet :

VC++ .NET

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 5
    Par défaut [Windows Forms]Passer d'une forme à une autre
    Bonjour,

    Après moulte recherches sur le net, je n'ai pas trouvé de code C++ afin que lorsque je clique sur un bouton, j'aille sur une autre form.

    Application : je suis sur ma form1 et je souhaite aller à une forme2 en cliquant sur un bouton.

    Merci d'avance pour vos réponses

    J'ai essayé de faire une instance, mais ce marche pas, voici mon code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    #pragma once
    #include "pageclient.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 booticcom {
     
    	/// <summary>
    	/// Description résumée de Pageacceuil
    	///
    	/// AVERTISSEMENT : si vous modifiez le nom de cette classe, vous devrez modifier la
    	///          propriété 'Nom du fichier de ressources' de l'outil de compilation de ressource managée
    	///          pour tous les fichiers .resx dont dépend cette classe. Dans le cas contraire,
    	///          les concepteurs ne pourront pas interagir correctement avec les ressources
    	///          localisées associées à ce formulaire.
    	/// </summary>
    	public ref class Pageacceuil : public System::Windows::Forms::Form
    	{
    	public:
    		Pageacceuil(void)
    		{
    			InitializeComponent();
    			//
    			//TODO : ajoutez ici le code du constructeur
    			//
    			isMouseDown = false;
    		}
     
    	public:
    			pageclient *page1;
     
    	protected:
    		/// <summary>
    		/// Nettoyage des ressources utilisées.
    		/// </summary>
    		~Pageacceuil()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
    	private: System::Windows::Forms::Label^  label1;
    	private: System::Windows::Forms::Button^  button1;
    	private: System::Windows::Forms::Button^  button2;
    	private: System::Windows::Forms::Button^  button3;
    			  bool isMouseDown;
    	protected: 
     
    	private:
    		/// <summary>
    		/// Variable nécessaire au concepteur.
    		/// </summary>
    		System::ComponentModel::Container ^components;
     
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
    		/// le contenu de cette méthode avec l'éditeur de code.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->label1 = (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->SuspendLayout();
    			// 
    			// label1
    			// 
    			this->label1->AutoSize = true;
    			this->label1->Font = (gcnew System::Drawing::Font(L"Calibri", 18, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
    				static_cast<System::Byte>(0)));
    			this->label1->Location = System::Drawing::Point(69, 29);
    			this->label1->Name = L"label1";
    			this->label1->Size = System::Drawing::Size(125, 29);
    			this->label1->TabIndex = 0;
    			this->label1->Text = L"Bootic.com";
    			// 
    			// button1
    			// 
    			this->button1->Location = System::Drawing::Point(96, 90);
    			this->button1->Name = L"button1";
    			this->button1->Size = System::Drawing::Size(75, 23);
    			this->button1->TabIndex = 1;
    			this->button1->Text = L"button1";
    			this->button1->UseVisualStyleBackColor = true;
    			this->button1->Click += gcnew System::EventHandler(this, &Pageacceuil::button1_Click);
    			this->button1->MouseClick += gcnew System::Windows::Forms::MouseEventHandler(this, &Pageacceuil::button1_MouseClick);
    			// 
    			// button2
    			// 
    			this->button2->Location = System::Drawing::Point(95, 145);
    			this->button2->Name = L"button2";
    			this->button2->Size = System::Drawing::Size(75, 23);
    			this->button2->TabIndex = 2;
    			this->button2->Text = L"button2";
    			this->button2->UseVisualStyleBackColor = true;
    			this->button2->Click += gcnew System::EventHandler(this, &Pageacceuil::button1_Click);
    			this->button2->MouseClick += gcnew System::Windows::Forms::MouseEventHandler(this, &Pageacceuil::button2_MouseClick);
    			// 
    			// button3
    			// 
    			this->button3->Location = System::Drawing::Point(94, 197);
    			this->button3->Name = L"button3";
    			this->button3->Size = System::Drawing::Size(75, 23);
    			this->button3->TabIndex = 3;
    			this->button3->Text = L"button3";
    			this->button3->UseVisualStyleBackColor = true;
    			// 
    			// Pageacceuil
    			// 
    			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->ClientSize = System::Drawing::Size(284, 264);
    			this->Controls->Add(this->button3);
    			this->Controls->Add(this->button2);
    			this->Controls->Add(this->button1);
    			this->Controls->Add(this->label1);
    			this->Name = L"Pageacceuil";
    			this->Text = L"Pageacceuil";
    			this->ResumeLayout(false);
    			this->PerformLayout();
     
    		}
    #pragma endregion
    	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) 
    			 {
     
    			 }
    	private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) 
    			 {
     
    			 }
     
    private: System::Void button1_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
    			 this->Close();
    		 }
    private: System::Void button2_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
    			page1->Show;
    		 }
    };
    }
    EDIT :

    Laissez tombé j'ai trouvé :p
    Merci quand même ^^

  2. #2
    Rédacteur
    Avatar de darrylsite
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    1 299
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Juillet 2007
    Messages : 1 299
    Par défaut
    Peux tu me montrer ce que tu as trouvé ? Je le cherche depuis un moment moi aussi.

  3. #3
    Rédacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par défaut
    tu peux t'inspirer de ce qu'il y a dans la faq http://dotnet.developpez.com/faq/cpp...s#crossinclude

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 2
    Dernier message: 27/02/2013, 14h37
  2. Réponses: 8
    Dernier message: 26/05/2010, 10h25
  3. Passer un paramétre d'une forme a une autre
    Par Ari31 dans le forum C++/CLI
    Réponses: 4
    Dernier message: 04/07/2007, 01h04
  4. [C#]Comment passer un parametre d une Form à l'autre ?
    Par ToxiZz dans le forum Windows Forms
    Réponses: 9
    Dernier message: 08/02/2006, 12h28
  5. Réponses: 2
    Dernier message: 04/10/2005, 20h54

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo