Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form2 : Form
- {
- List<string> namen = new List<string>();
- List<int> nummer = new List<int>();
- List<int> alter = new List<int>();
- public Form2()
- {
- InitializeComponent();
- nummer.Add(1);
- nummer.Add(2);
- nummer.Add(3);
- namen.Add("Hans");
- namen.Add("Franz");
- namen.Add("Kevin");
- alter.Add(57);
- alter.Add(33);
- alter.Add(13);
- }
- private void Form2_Load(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {/*
- ListViewItem a = new ListViewItem("1");
- a.SubItems.Add("Hans");
- a.SubItems.Add("57");
- ListViewItem b = new ListViewItem("2");
- b.SubItems.Add("Franz");
- b.SubItems.Add("33");
- ListViewItem c = new ListViewItem("3");
- c.SubItems.Add("Kevin");
- c.SubItems.Add("13");
- listView1.Items.AddRange(new ListViewItem[] { a, b, c });
- this.Controls.Add(listView1);
- */
- for (int a = 0; !string.IsNullOrEmpty(namen[a]); a++)
- {
- ListViewItem namen[a] = new ListViewItem(a + 1);
- a.SubItems.Add(namen[a]);
- a.SubItems.Add(alter[a]);
- }
- int a;
- listView1.Items.AddRange(new ListViewItem[]
- {
- for ( a= 0; !string.IsNullOrEmpty(namen[a+1]); a++)
- {
- namen[a],
- }
- namen[a]
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement