c# - How to get a list in a MessageBox? -
how can display contents of string list in body of message box?
here's have far:
list<string> = new list<string> {}; foreach (datagridviewcell cell in dgvc.selectedcells) { a.add(cell.value.tostring()); } messagebox.show(a); // doesn't work !?
messagebox requires string not list
stringbuilder sb = new stringbuilder(); foreach (datagridviewcell cell in dgvc.selectedcells) { sb.appendline(cell.value.tostring()); } messagebox.show(sb.tostring());
Comments
Post a Comment