Hello
My C # project has a listbox that lists numbers entered by the user. What I want to do is to constantly update these numbers in the listbox.
I tried to use the Sorted tool, but what happens is: link
In print: I entered with the values 1,2,3,4,5,6 and when I entered with the value 11, it appeared just below the 1.
Confirm Value Button Code:
if (tbNumero.Text == "")
{
MessageBox.Show("Não foi digitado nenhum número.", "Erro!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
try
{
lstRoll.Items.Add(Convert.ToDouble(tbNumero.Text));
btnRemoveRoll.Enabled = true;
btnResetAll.Enabled = true;
tbNumero.Text = "";
tbNumero.Focus();
lstRoll.Sorted = true;
}
catch (Exception)
{
MessageBox.Show("Por favor, digite apenas numeros", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
tbNumero.Text = "";
tbNumero.Focus();
}
}
Resolved with this video: link