[ Foro de C++ ]

Redireccionar a otro winform C++/CLI Error Constructor

26-Aug-2021 21:09
aaaaaaa bbbbbbb
0 Respuestas

Hola, foreros, cómo les va?.....................Me sale este error cuando quiero programar el segundo Boton para redireccionar o llamar a otro Form.....seria el unico  que saldria,  funcionaría la solución....


Error   1   error C3673: 'Cualquiera::Form2' : la clase no tiene un constructor de copia

#pragma once
#include "Form2.h"


namespace Cualquiera {

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>
/// Resumen de Form1
///
/// ADVERTENCIA: si cambia el nombre de esta clase, deberá cambiar la
///          propiedad 'Nombre de archivos de recursos' de la herramienta de compilación de recursos administrados
///          asociada con todos los archivos .resx de los que depende esta clase. De lo contrario,
///          los diseñadores no podrán interactuar correctamente con los
///          recursos adaptados asociados con este formulario.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
 Form1(void)
 {
  InitializeComponent();
  //
  //TODO: agregar código de constructor aquí
  //
 }

protected:
 /// <summary>
 /// Limpiar los recursos que se estén utilizando.
 /// </summary>
 ~Form1()
 {
  if (components)
  {
   delete components;
  }
 }
private: System::Windows::Forms::Button^  Guardar1;
protected:

protected:


private: System::Windows::Forms::Label^  label1;
private: System::Windows::Forms::Label^  label2;
private: System::Windows::Forms::Button^  button2;

private:
 /// <summary>
 /// Variable del diseñador requerida.
 /// </summary>
 System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
 /// <summary>
 /// Método necesario para admitir el Diseñador. No se puede modificar
 /// el contenido del método con el editor de código.
 /// </summary>
 void InitializeComponent(void)
 {
  this->Guardar1 = (gcnew System::Windows::Forms::Button());
  this->label1 = (gcnew System::Windows::Forms::Label());
  this->label2 = (gcnew System::Windows::Forms::Label());
  this->button2 = (gcnew System::Windows::Forms::Button());
  this->SuspendLayout();
  //
  // Guardar1
  //
  this->Guardar1->BackColor = System::Drawing::SystemColors::ActiveCaption;
  this->Guardar1->ForeColor = System::Drawing::SystemColors::ControlText;
  this->Guardar1->Location = System::Drawing::Point(95, 73);
  this->Guardar1->Name = L"Guardar1";
  this->Guardar1->Size = System::Drawing::Size(75, 23);
  this->Guardar1->TabIndex = 0;
  this->Guardar1->Text = L"Click Aquí";
  this->Guardar1->UseVisualStyleBackColor = false;
  this->Guardar1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  //
  // label1
  //
  this->label1->Enabled = false;
  this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
   static_cast<System::Byte>(0)));
  this->label1->ForeColor = System::Drawing::SystemColors::ControlText;
  this->label1->Location = System::Drawing::Point(60, 117);
  this->label1->Name = L"label1";
  this->label1->Size = System::Drawing::Size(157, 23);
  this->label1->TabIndex = 0;
  //
  // label2
  //
  this->label2->AutoSize = true;
  this->label2->Font = (gcnew System::Drawing::Font(L"Open Sans Semibold", 8.25F, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic)),
   System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
  this->label2->Location = System::Drawing::Point(61, 33);
  this->label2->Name = L"label2";
  this->label2->Size = System::Drawing::Size(167, 15);
  this->label2->TabIndex = 1;
  this->label2->Text = L"Por favor, Haga Click en Botón";
  //
  // button2
  //
  this->button2->BackColor = System::Drawing::SystemColors::ActiveCaption;
  this->button2->ForeColor = System::Drawing::SystemColors::ControlText;
  this->button2->Location = System::Drawing::Point(95, 193);
  this->button2->Name = L"button2";
  this->button2->Size = System::Drawing::Size(75, 23);
  this->button2->TabIndex = 2;
  this->button2->Text = L"Continuar";
  this->button2->UseVisualStyleBackColor = false;
  this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
  //
  // Form1
  //
  this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  this->ClientSize = System::Drawing::Size(284, 262);
  this->Controls->Add(this->button2);
  this->Controls->Add(this->label2);
  this->Controls->Add(this->label1);
  this->Controls->Add(this->Guardar1);
  this->Name = L"Form1";
  this->Text = L"Label Hola Mundo";
  this->ResumeLayout(false);
  this->PerformLayout();

 }
 
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)
   {
     label1->Text = "Hola Mundo";
   }

private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {


  Form2^ frm2 = gcnew Form2(this);
        frm2->Show();
        this->Hide();
  }
};
}

Agradezco cualquier ayuda....





(No se puede continuar esta discusión porque tiene más de dos meses de antigüedad. Si tienes dudas parecidas, abre un nuevo hilo.)