J
jimi_xyz
I am kind of new to C sharp; I have a quick question I have multiple
text boxes 12 of them to be exact. What I want to do is fill them with
values that are in a array of integers. The way I am currently doing
this is like this..
input0.Text = Convert.ToString(arr[0]);
input1.Text = Convert.ToString(arr[1]);
input2.Text = Convert.ToString(arr[2]);
input3.Text = Convert.ToString(arr[3]);
input4.Text = Convert.ToString(arr[4]);
input5.Text = Convert.ToString(arr[5]);
input6.Text = Convert.ToString(arr[6]);
input7.Text = Convert.ToString(arr[7]);
input8.Text = Convert.ToString(arr[8]);
input9.Text = Convert.ToString(arr[9]);
input10.Text = Convert.ToString(arr[10]);
input11.Text = Convert.ToString(arr[11]);
What I am looking for is about 3 lines of code; something like this...
for(i = 0; i< arr.Length; i++)
{
input.Text = Convert.ToString(arr);
//NOTE: I am using as the subscript for the texboxes
}
I doubt this can be done in C sharp; but any help or ideas will be
appreciated. Also note that I posted the same message on the c-sharp
message board; but it doesn't look like it gets as much traffic as this
group does.
Thanks,
-Jimmie
text boxes 12 of them to be exact. What I want to do is fill them with
values that are in a array of integers. The way I am currently doing
this is like this..
input0.Text = Convert.ToString(arr[0]);
input1.Text = Convert.ToString(arr[1]);
input2.Text = Convert.ToString(arr[2]);
input3.Text = Convert.ToString(arr[3]);
input4.Text = Convert.ToString(arr[4]);
input5.Text = Convert.ToString(arr[5]);
input6.Text = Convert.ToString(arr[6]);
input7.Text = Convert.ToString(arr[7]);
input8.Text = Convert.ToString(arr[8]);
input9.Text = Convert.ToString(arr[9]);
input10.Text = Convert.ToString(arr[10]);
input11.Text = Convert.ToString(arr[11]);
What I am looking for is about 3 lines of code; something like this...
for(i = 0; i< arr.Length; i++)
{
input.Text = Convert.ToString(arr);
//NOTE: I am using as the subscript for the texboxes
}
I doubt this can be done in C sharp; but any help or ideas will be
appreciated. Also note that I posted the same message on the c-sharp
message board; but it doesn't look like it gets as much traffic as this
group does.
Thanks,
-Jimmie