0

Hey guys, I just wanted to know how exactly can i change the location from pbx1 to pbx1_1. Its a card game and as soon as i click on pbx1 it must move to pbx1_1, But im not sure how to do that.Please help

 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        bool Draw_Clicked = false;
        bool pbx1M = false;

        public void Cards()
        {
            Random rdm = new Random();
            int R = rdm.Next(0, 5);

            if (R == 0)
            {
                pbx1.Image = global::Yugioh_Beta1.Properties.Resources._0;
                txtCardInfo.Text = "ATK = 1600";
            }
            if (R == 1)
            {
                pbx2.Image = global::Yugioh_Beta1.Properties.Resources._1;
                txtCardInfo.Text = "ATK = 550";
            }
            if (R == 2)
            {
                pbx3.Image = global::Yugioh_Beta1.Properties.Resources._2;
                txtCardInfo.Text = "ATK = 1800";
            }
            if (R == 3)
            {
                pbx4.Image = global::Yugioh_Beta1.Properties.Resources._3;
                txtCardInfo.Text = "ATK = 4700";
            }
            if (R == 4)
            {
                pbx5.Image = global::Yugioh_Beta1.Properties.Resources._4;
                txtCardInfo.Text = "ATK = 2400";
            }
        }

        private void Draw_Click(object sender, EventArgs e)
        {
            Draw_Clicked = true;
            if (Draw_Clicked == true)
            {
                Cards();
            }

        }

        private void pbx1_Click(object sender, EventArgs e)
        {
            pbx1M = true;
            if (pbx1M == true)
            {
                pbx1 = pbx1_1;
            }
        }
2
Contributors
1
Reply
13
Views
3 Years
Discussion Span
Last Post by ChrisHunter
0

Take a look at this link.

In your case you might just need to set the value of pbx1_1.Image to the value of pbx1.Image, within the pbx1_MouseClick method.

Good luck...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.