3
I’m having difficulty showing information that comes from an object to display on a Label, returning in list form.
//Pegando os dados do Rest e armazenando na variável usuários
var usuario = response.Content.ReadAsAsync<IEnumerable<ConsumeRoot>>().Result;
foreach (var a in usuario)
{
lblTitulo.Text = a.titulo;
}
The label returns only one information, this class is receiving an API that is receiving information from a database, are 6 information that is to appear in this label informs stack.
In addition to the allocation operator error,
Label
is not recommended to show lists, a control likeBulletedList
(web Forms),ListBox
(win Forms) orListView
(Xamarin) would be more appropriate– Lucas
Young man, I realized that you are trying to accept both answers as correct. You need to choose only one to score. If the two helped you, you can vote positively on both, but mark as correct only one.
– Jéf Bueno