私は2つのフォームを接続しようとすると、私は成功し、それらを接続するが、問題は、私はForm1のからのForm2を開いたときに、その後のForm2が開きますが、Form2のは、そのボタンが表示されないということである、テキストなどを接続二つの形式
私が使用these instructions。
私はVisual Studio 2012を使用しています。私はVisual Studioがこれを誤ってやっていると思います。私は新しいVisual Studioをインストールする必要があります。
のForm1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Login_Form
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.Show();
}
// Create Form2.
public class Form2 : Form
{
public Form2()
{
Text = "Form2";
}
}
}
}
Form2の
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Login_Form
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void Form2_Load(object sender, EventArgs e)
{
}
}
}
を次のコードスニペットを削除します)。 ? – Bahrom
もう一度、コードを表示してください。 – Trey
はいこれにはInitializeComponent()が含まれています。 @Bahrom –