CodePudding user response:
The following is my on baidu to find the answer, can't readStudent stu1 []=new student [3]. The definition of the student class can directly write? Don't need any matting??
And the name and the class don't need to define? Look not to understand, novice self-study problems well
Private void button1_Click (object sender, EventArgs e)
{
Enclosing textBox1. Text=stu1 [this. ListBox1. SelectedIndex]. Classes;
}
Student stu1 []=new student [3].
Private void Form1_Load (object sender, EventArgs e)
{
Stu1 [0]=new student (" s0 ", "c00");
Stu1 [1]=new student (" s1 ", "c01");
Stu1 [2]=new student (" s2 ", "our fleet");
For (int I=0; I & lt; Stu1. Length; I++)
This. The listBox1. Items. The Add (stu1 [I] name);
}
}
Define the class alone, in the three students, for example
CodePudding user response:
The following is my on baidu to find the answer, can't readStudent stu1 []=new student [3]. The definition of the student class can directly write? Don't need any matting??
And the name and the class don't need to define? Look not to understand, novice self-study problems well
Private void button1_Click (object sender, EventArgs e)
{
Enclosing textBox1. Text=stu1 [this. ListBox1. SelectedIndex]. Classes;
}
Student stu1 []=new student [3].
Private void Form1_Load (object sender, EventArgs e)
{
Stu1 [0]=new student (" s0 ", "c00");
Stu1 [1]=new student (" s1 ", "c01");
Stu1 [2]=new student (" s2 ", "our fleet");
For (int I=0; I & lt; Stu1. Length; I++)
This. The listBox1. Items. The Add (stu1 [I] name);
}
}
Define the class alone, in the three students, for example