private void button1_Click(object sender, EventArgs e) { string Aux1; string[] Aux2; string[] Aux3; string[] Aux4; listView1.Items.Clear(); Aux1 = Jogo.ListarPartidas(); Aux1 = Aux1.Replace("\r", ""); Aux2 = Aux1.Split('\n'); ListViewItem itm; for (int i = 0; i < Aux2.Length - 1; i++) { Aux3 = Aux2[i].Split(','); Aux4 = Aux3; if (Aux3[0] == "A") { Aux4[0] = Aux3[1]; Aux4[1] = Aux3[3]; Aux4[2] = Aux3[2]; itm = new ListViewItem(Aux4); listView1.Items.Add(itm); } } }
private void Entrar_Nova_Load(object sender, EventArgs e) { string Aux1; string[] Aux2; string[] Aux3; string[] Aux4; listView1.View = View.Details; listView1.GridLines = true; listView1.FullRowSelect = true; listView1.MultiSelect = false; //Add column header listView1.Columns.Add("ID", 60, HorizontalAlignment.Center); listView1.Columns.Add("NOME", 150, HorizontalAlignment.Center); listView1.Columns.Add("CRIAÇÃO", 78, HorizontalAlignment.Center); Aux1 = Jogo.ListarPartidas(); Aux1 = Aux1.Replace("\r", ""); Aux2 = Aux1.Split('\n'); ListViewItem itm; for (int i = 0; i < Aux2.Length - 1; i++) { Aux3 = Aux2[i].Split(','); Aux4 = Aux3; if (Aux3[0] == "A") { Aux4[0] = Aux3[1]; Aux4[1] = Aux3[3]; Aux4[2] = Aux3[2]; itm = new ListViewItem(Aux4); listView1.Items.Add(itm); } } }