Hi there.
I need help on getting the values of the 6 textbox's and find 3 lowest ones.
Thank you
Textbox to array
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Vimal KandasamyRank #2,151 · 661 reputationPosted Mar 26, 2009, 1:51 AM EDT
you can store values of Textbox into array like
arr[0]=int.Parse(textBox1.Text);
etc
etc
then simply sort it... you will get lowest values in 1st three index of array...
following code will help you to sort.
for (int i = 0; i < arr.Length; i++)
{
for (int j = i + 1; j < arr.Length; j++)
{
if (arr[i] > arr[j])
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}