1 hari
(子窗体)
arrlOut ArrayList pribadi;
public ArrayList arrlIn//要用pulibc
{
mengatur
{
ini .arrlOut = nilai;//这里不能用arrlIn而要单独声明一个变量
}
mendapatkan
{
kembalikan .arrlOut ini;
}
}
(主窗体,由它向子窗体传传值)
menggunakan System.Collections;//ArrayList引用空间
arrlOut ArrayList pribadi;
private void btnShowForm4_Click(pengirim objek, EventArgs e)
{
Form4 form4StudentInformation = Form4 baru();
form4StudentInformation.arrlIn = ini.arrlOut ;
form4StudentInformation.Show();
}
2 foto
(主窗体)
menggunakan System.Collections;//ArrayList引用空间
arrlOut ArrayList pribadi;
private void btnShowForm3_Click(pengirim objek, EventArgs e)
{
Form3 formStudentInformation = Form3 baru();
formStudentInformation.setArray(arrlOut);
formStudentInformation.Tampilkan();
}
(子窗体)
arrlOut ArrayList pribadi;
public void setArray(ArrayList arrayin)//要用pulibc
{
arrlOut = larik;
}
3构造函数传值
(子窗体)
arrlOut ArrayList pribadi;
public studentOneInformationForm(ArrayList arrlIn)//构造函数中加了参数
{
Inisialisasi Komponen();
arrlOut = arrlIn;
}
(主窗体)
private void showFormInformation_Click(pengirim objek, EventArgs e)
{
studentOneInformationForm studentOne = new studentOneInformationForm(this.arrlOut);//传参数
studentOne.Tampilkan();
}