要求如下:
代码如下:
namespace _4._2._2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
Random random = new Random();
label1.Text = random.Next(10).ToString();
label2.Text = random.Next(10).ToString();
label3.Text = random.Next(10).ToString();
label4.Text = random.Next(10).ToString();
label5.Text = random.Next(10).ToString();
label6.Text = random.Next(10).ToString();
label7.Text = random.Next(10).ToString();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void pictureBox2_Click(object sender, EventArgs e)
{
timer1.Enabled = !timer1.Enabled;
}
}
}
属性操作:
边框透明:把属性formborderstyle设置成知NONE,这样就可以实现窗体无边框;
图片透明:BackColor设置为Transparent(web中)
在摇奖框中,若想操作简单一点,可以把lable放在panel中,然后将其设置为自己喜欢的颜色就可完全覆盖原来框中的数字
结果如下: