RT:
int[] arr = new int[4] { 4, 3, 2, 1 };
数组里的值
form 窗体有4个 label 空间 用循环 放值 咋搞?
好像是用 foreach
int[] arr = new int[4] { 4, 3, 2, 1 };
数组里的值
form 窗体有4个 label 空间 用循环 放值 咋搞?
好像是用 foreach
解决方案 »
- 如何将“+”变为加号???:在RadioButton中我有“+、-、*、、”四个字符串,我选中一个后可以进行计算,但是怎样将字符串变为加减乘除呢?
- 如何设置ToolStripButton在ToolStrip的位置
- 关于C# Socket组播的问题,求教大虾!!
- c#中在Paint函数中载入资源图为何不停地重绘?
- 如何隐藏listview列表中的某一列,即使拖动它也能不显示。
- 如何往本地写一个excel文件,而且不需要用户按保存按钮(在线等待)
- 有很高参考价值的软件源码 请参看 成熟商业 财务进销存早期版本源码分享(30M完全C#) 每信必复
- 100分求助 怎样用javascript显示保存对话框
- vs2003编辑器里的字体好小,怎么才能放大一点呢?(我很菜的,汗)
- c#可视化
- UserControl的问题
- C#如何使用https向exe程序发送消息
private void button1_Click(object sender, EventArgs e)
{
string[] str=new string[] {"AAA","BBB","CCC"}; Label[] lbl = new Label[] { label1,label2,label3 }; for (int i = 0; i < str.Length; i++)
{
lbl[i].Text = str[i];
} }
int index = 0;
foreach(Control c in this.Controls)
{
if(c is Label && index<arr.Length)
{
((Label)c).Text = arr[index++].ToString();
}
}