I searched for about half an hour through Google to answer my question, but no one seems to have posted any solutions. I am working on a Windows Forms Application and has ListDialogBoxone that does not seem to accept any of the methods that I tried to display on a new line when I add display elements withStringBuilder
Code snippet:
public string VehicleInfo()
StringBuilder sb = new StringBuilder();
List<Vehicle> _vehicles = new List<Vehicle>(Vehicle v1, Vehicle v2, and so on...);
foreach (Vehicle v in _vehicles)
{
sb.Append(v.VIN);
sb.Append(v.Make);
sb.Append(v.Model);
sb.Append(v.Year);
sb.Append(v.Color);
sb.Append(v.License);
sb.Append("\n");
sb.Append("\\n");
sb.Append("\r\n");
sb.AppendLine();
sb.AppendLine(Environment.NewLine);
}
return sb.ToString();
}
And then I add display items to the list dialog
ListDialog ld = new ListDialog();
ld.AddDisplayItems(Owner.ToString());
ld.AddDisplayItems(Owner.VehicleInfo());
ld.ShowDialog();
, , . , , .
, StringBuilder Vehicle , , .
/ !