S
SashaT
namespace Slotmachine
{
public partial class Form1 : Form
{
private System.Random r;
private int LastScope;
private int TotalScope;
private int Card2;
private int Card3;
public Form1()
{
InitializeComponent();
r = new Random();
LastScope = 0;
TotalScope = 0;
Card2 = 0;
Card3 = 0;
}
private int SetImage(PictureBox pb)
{
int i = r.Next(0, 5);
pb.Image = imageList1.Images;
return i;
}
private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
{
pictureBox1.Image = (Image) Properties.Resources.ResourceManager.GetObject("Top");
int i1 = SetImage(pictureBox2);
int i2 = SetImage(pictureBox3);
int i3 = SetImage(pictureBox4);
if ((i1 == i2) || (i2 == i3) || (i1 == i3))
{
LastScope = 10;
Card2++;
}
if ((i1 == i2) && (i2 == i3))
{
LastScope = 50;
Card3++;
}
TotalScope += LastScope;
LastScopeLabel.Text = LastScope.ToString();
TotalScopeLabel.Text = TotalScope.ToString();
Card2Label.Text = Card2.ToString();
Card3Label.Text = Card3.ToString();
LastScope = 0;
}
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
Bitmap a = (Bitmap)Properties.Resources.ResourceManager.GetObject("Bottom");
pictureBox1.Image = a;
}
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.Image = (Image)Properties.Resources.ResourceManager.GetObject("Top");
pictureBox2.Image = (Image)Properties.Resources.ResourceManager.GetObject("suit1");
pictureBox3.Image = (Image)Properties.Resources.ResourceManager.GetObject("suit1");
pictureBox4.Image = (Image)Properties.Resources.ResourceManager.GetObject("suit1");
}
Народ Помогите Мне надо сделать так чтобы работала программа, Она щас правильная, Но надо убрать Set Image, я вобще не знаю как сделать))
{
public partial class Form1 : Form
{
private System.Random r;
private int LastScope;
private int TotalScope;
private int Card2;
private int Card3;
public Form1()
{
InitializeComponent();
r = new Random();
LastScope = 0;
TotalScope = 0;
Card2 = 0;
Card3 = 0;
}
private int SetImage(PictureBox pb)
{
int i = r.Next(0, 5);
pb.Image = imageList1.Images;
return i;
}
private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
{
pictureBox1.Image = (Image) Properties.Resources.ResourceManager.GetObject("Top");
int i1 = SetImage(pictureBox2);
int i2 = SetImage(pictureBox3);
int i3 = SetImage(pictureBox4);
if ((i1 == i2) || (i2 == i3) || (i1 == i3))
{
LastScope = 10;
Card2++;
}
if ((i1 == i2) && (i2 == i3))
{
LastScope = 50;
Card3++;
}
TotalScope += LastScope;
LastScopeLabel.Text = LastScope.ToString();
TotalScopeLabel.Text = TotalScope.ToString();
Card2Label.Text = Card2.ToString();
Card3Label.Text = Card3.ToString();
LastScope = 0;
}
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
Bitmap a = (Bitmap)Properties.Resources.ResourceManager.GetObject("Bottom");
pictureBox1.Image = a;
}
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.Image = (Image)Properties.Resources.ResourceManager.GetObject("Top");
pictureBox2.Image = (Image)Properties.Resources.ResourceManager.GetObject("suit1");
pictureBox3.Image = (Image)Properties.Resources.ResourceManager.GetObject("suit1");
pictureBox4.Image = (Image)Properties.Resources.ResourceManager.GetObject("suit1");
}
Народ Помогите Мне надо сделать так чтобы работала программа, Она щас правильная, Но надо убрать Set Image, я вобще не знаю как сделать))