saeedizade
جمعه 28 فروردین 1394, 14:29 عصر
سلام
می خواهم با کلیک بر روی عکس یک واحد به x اضافه شود و در لیبل چاپ شود ولی این کارو نمیکنه چرا
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
int x = 0;
private void img1_Click(object sender, EventArgs e)
{
Random ran = new Random();
img1.Left = ran.Next(0,536);
img1.Top= ran.Next(0, 330);
x += 1;
}
public Form1()
{
InitializeComponent();
l1.Text = x;
}
}
}
می خواهم با کلیک بر روی عکس یک واحد به x اضافه شود و در لیبل چاپ شود ولی این کارو نمیکنه چرا
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
int x = 0;
private void img1_Click(object sender, EventArgs e)
{
Random ran = new Random();
img1.Left = ran.Next(0,536);
img1.Top= ran.Next(0, 330);
x += 1;
}
public Form1()
{
InitializeComponent();
l1.Text = x;
}
}
}