Y de código tengo esto:
XmlNodeList xml = lista.GetElementsByTagName("Respuesta");
foreach (XmlElement res in xml)
{
lstCanciones.Items.Add(res.GetAttribute("nombre"));
lstCanciones.Update();
}
Stack Overflow en español es un sitio de preguntas y respuestas para programadores y profesionales de la informática. Solo te toma un minuto registrarte.
Regístrate para unirte a esta comunidadY de código tengo esto:
XmlNodeList xml = lista.GetElementsByTagName("Respuesta");
foreach (XmlElement res in xml)
{
lstCanciones.Items.Add(res.GetAttribute("nombre"));
lstCanciones.Update();
}
No entiendo bien tu problema, pero tal vez te sirva esta página del sitio de Microsoft MSDN.
Tu forma de refrescar la lista es ineficiente. Utiliza BeginUpdate
y EndUpdate
como en:
listBox1.BeginUpdate();
// Loop through and add 50 items to the ListBox.
for (int x = 1; x <= 50; x++)
{
listBox1.Items.Add("Item " + x.ToString());
}
// Allow the ListBox to repaint and display the new items.
listBox1.EndUpdate();
ListBox
. Intenta mejorar tu respuesta orientándola a esa situación.
el 14 may. 2018 a las 4:29