110,534
社区成员
发帖
与我相关
我的任务
分享
//1.
private void textBox1_TextChanged(object sender, EventArgs e)
{
label1.Text = textBox1.Text;
string asc="";
for (int i = 0; i < textBox1.Text.Length; i++) //长度必须有
{
asc += ((Int32)textBox1.Text[i]).ToString() + " "; //转为ASCII是Int32
}
label2.Text = asc.ToString();
}
//2.可以参考楼上,
也可以放个时间控件,在事件里移动:
this.Location = new Point(this.Left + XXX, this.Top+YYYY);
(XXX:窗体每次向右移动的距离,YYYY:窗体每次向下移动的距离)
具体看你要达到什么效果了
label1.Text = textBox1.Text;
string ascii = "";
for (int i = 0; i < textBox1.Text.Length; i++)
{
ascii += ((char)textBox1.Text[i]).ToString() + " ";
}
label2.Text = ascii;
for (int i = 0; i < 30; i++)
{
this.Location = new Point(this.Left + 10, this.Top);
Application.DoEvents();
Thread.Sleep(100);
}