public partial class Form1 : Form
{
string[] names = new string [20]
{"John","Susy","Obedia","Saul","Abram","Lincoln","Abraham","Eli","Kain","Abel",
"Will","Smitty","Scott","Julie","Ramona","Melissa","Todd","Lilly","Naomi","Leland"};
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//Question #1 Pop Names in listbox
for (int i = 0; i < names.Length; i++)
{
listBox1.Items.Add(names[i]);
}
}
これは私listbox1
が入力した方法ですが、今でlistbox2
は各名前の長さを表示したいと思います. これを C# コードでどのように見つけるのか疑問に思っています。