using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace cch
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void textBox4_TextChanged(object sender, EventArgs e)
{ } private void btn1_Click(object sender, EventArgs e)
{
int m = 0;
TextBox[] p = new TextBox[] {tb1,tb2,tb3,tb4,tb5,tb6 };
int i;
for (i = 0; i < 6; i++)
{
if (p[i].Text!="")
{
m++;
}
}
string a = string.Format("你选择了红球{0}个,号码分别是{1}", m);
lb8.Text = a;
}
}
}
我想把p[i].Text的值读出来,放在“号码分别是{1}”, 该怎么做?
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace cch
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void textBox4_TextChanged(object sender, EventArgs e)
{ } private void btn1_Click(object sender, EventArgs e)
{
int m = 0;
TextBox[] p = new TextBox[] {tb1,tb2,tb3,tb4,tb5,tb6 };
int i;
for (i = 0; i < 6; i++)
{
if (p[i].Text!="")
{
m++;
}
}
string a = string.Format("你选择了红球{0}个,号码分别是{1}", m);
lb8.Text = a;
}
}
}
我想把p[i].Text的值读出来,放在“号码分别是{1}”, 该怎么做?
解决方案 »
- WPF程序如何调用DirectX API画图
- 关于GDI+绘制复杂线型
- string和int类型转换问题
- C#自定义事件的问题
- 求解怎样实现一般控件跟随“光标”动态移动?
- dev控件layoutview和layoutcontrol打印时没有线条
- datagridview中使用rowfilter出现的神奇现象
- treeview控件,如何判断?
- 这一题哪一个正确是正确的
- ASP与ASP.NET有何区别?ASP.NET指的是一种开发工具吗?ASP的开发使用的开发环境,应该是VB.NET、C#.NET、J#.NET、C++.NET其中的一种?
- 老掉牙的问题了 不好意思问了 但是我还没解决
- VS2005使用问题?
string.Format("你选择了红球{0}个,号码分别是{1}",m, p[m].Text);
TextBox[] p = new TextBox[] {tb1,tb2,tb3,tb4,tb5,tb6 };
int i;
for (i = 0; i < 6; i++)
{
if (p[i].Text!="")
{
m++; s += p[i].Text + ";";
}
}
string a = string.Format("你选择了红球{0}个,号码分别是{1}", m,s);
lb8.Text = a; 搞彩票吗?
int m = 0;
string s = "";
TextBox[] p = new TextBox[] {tb1,tb2,tb3,tb4,tb5,tb6 };
int i;
for (i = 0; i < TextBox.Length; i++)
{
if (p[i].Text!="")
{
m++; s += p[i].Text + ";";
}
}
string a = string.Format("你选择了红球{0}个,号码分别是{1}", m,s);
lb8.Text = a;