Thursday, June 23, 2011

How to create a Memory Game in C#?

 '===========================================================
'====   Programmed by:      Ranjeet kumar
'====   Email:             ddkhune@gmail.com
'==== 
'==== 
'====   Note:               Send me feedback regarding
'====                       this application
'====
'==== 
'====
'===========================================================

#region Using directives


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Media;
#endregion
namespace Ranjeet_MindBlowing_memory_game
{
    public partial class memoryGame : Form
    {
        public memoryGame()
        {
            InitializeComponent();
        }
        int choice;

        int[] picked = new int[3];
        int[] behind = new int[17];
        int guesses, remaining;
        SoundPlayer matchSound = new SoundPlayer();
        SoundPlayer noMatchSound = new SoundPlayer();
        PictureBox[] boxes = new PictureBox[17];
        PictureBox[] choices = new PictureBox[9];
        Random myRandom = new Random();
        private void picHidden_Click(object sender, EventArgs e)
        {
            PictureBox pictureClicked;
            int index;
            DateTime start;
            TimeSpan delay;
            pictureClicked = (PictureBox)sender;
            index = Convert.ToInt32(pictureClicked.Name.Substring(9, 2));
          
            if ((choice == 2 && index == picked[1]) || behind[index] == -1 || btnNew.Enabled)
            {
                return;
            }
        
            boxes[index].Image = choices[behind[index]].Image;
            boxes[index].Refresh();
            if (choice == 1)
            {
                picked[1] = index;
                choice = 2;
                return;
            }
            guesses++;
            lblGuesses.Text = Convert.ToString(guesses);
            picked[2] = index;
            if (behind[picked[1]] == behind[picked[2]])
            {
              
                matchSound.Play();
                behind[picked[1]] = -1;
                behind[picked[2]] = -1;
                remaining--;
            }
            else
            {
              
                noMatchSound.Play();
                // delay one second
                start = DateTime.Now;
                do
                {
                    delay = DateTime.Now - start;
                }
                while (delay.Seconds <= 1.0);
                boxes[picked[1]].Image = picBack.Image;
                boxes[picked[2]].Image = picBack.Image;
            }
            choice = 1;
            if (remaining == 0)
            {
                btnExit.PerformClick();
                btnNew.Focus();
            }
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            if (btnExit.Text == "E&xit")
            {
                this.Close();
            }
            else
            {
                btnExit.Text = "E&xit";
                btnNew.Enabled = true;
            }
        }



        private void lblGuesses_Click(object sender, EventArgs e)
        {

        }

        private void pictureBox33_Click(object sender, EventArgs e)
        {

        }

        private void pictureBox25_Click(object sender, EventArgs e)
        {

        }

        private void Bitthdayr_Load(object sender, EventArgs e)
        {
             int i;
                        boxes[1] = picHidden01;
            boxes[2] = picHidden02;
            boxes[3] = picHidden03;
            boxes[4] = picHidden04;
            boxes[5] = picHidden05;
            boxes[6] = picHidden06;
            boxes[7] = picHidden07;
            boxes[8] = picHidden08;
            boxes[9] = picHidden09;
            boxes[10] = picHidden10;
            boxes[11] = picHidden11;
            boxes[12] = picHidden12;
            boxes[13] = picHidden13;
            boxes[14] = picHidden14;
            boxes[15] = picHidden15;
            boxes[16] = picHidden16;
            choices[1] = picChoice1;
            choices[2] = picChoice2;
            choices[3] = picChoice3;
            choices[4] = picChoice4;
            choices[5] = picChoice5;
            choices[6] = picChoice6;
            choices[7] = picChoice7;
            choices[8] = picChoice8;

         
            for (i = 1; i < 17; i++)
            {
                boxes[i].Click += new EventHandler(picHidden_Click);
            }
            noMatchSound.SoundLocation = Application.StartupPath + "\\uhoh.wav";
            matchSound.SoundLocation = Application.StartupPath + "\\tada.wav";
            btnNew.PerformClick();
        }

        private void btnNew_Click(object sender, EventArgs e)
        {
            int i;
            guesses = 0; remaining = 8;
            lblGuesses.Text = "0";
           
            Shuffle(16, behind);
            for (i = 1; i < 17; i++)
            {
              
                boxes[i].Image = picBack.Image;
                if (behind[i] > 8)
                {
                    behind[i] -= 8;
                }
            }
            choice = 1;
            btnNew.Enabled = false;
            btnExit.Text = "&Stop";
        }

        private void Shuffle(int numberOfItems, int[] numberList)
        {
           
            int tempValue, loopCounter, itemPicked, remaining;
          
            for (loopCounter = 1; loopCounter <= numberOfItems; loopCounter++)
            {
                numberList[loopCounter] = loopCounter;
            }
          
         
            for (remaining = numberOfItems; remaining >= 2; remaining--)
            {
              
                itemPicked = myRandom.Next(remaining) + 1;
               
                tempValue = numberList[remaining];
                numberList[remaining] = numberList[itemPicked];
                numberList[itemPicked] = tempValue;
            }
        }

     

        private void btnExit_Click_1(object sender, EventArgs e)
        {
             if (btnExit.Text == "E&xit")
            {
                this.Close();
            }
            else
            {
                btnExit.Text = "E&xit";
                btnNew.Enabled = true;
            }
        }
        }
       

      

        }
   

How to create a image slider in c#?


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;


namespace ranjeet_image_demo
{
    public partial class ImageSlider : Form
    {
        int filemax = 0;
        int filecount = 0;


        public ImageSlider()
        {
            InitializeComponent();
        }
     
        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {

            FolderBrowserDialog dlg = new FolderBrowserDialog();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                filemax = 0;
                panel1.Controls.Clear();
                foreach (String a in Directory.GetFiles(dlg.SelectedPath))
                {
                    if ((a.EndsWith(".jpg")) || (a.EndsWith(".png")) || (a.EndsWith(".gif")) || (a.EndsWith(".bmp")) || (a.EndsWith(".jpeg")))
                    {
                        PictureBox pb = new PictureBox();
                        Image im = Image.FromFile(a);
                        pb.Image = im;
                        panel1.Controls.Add(pb);
                        filemax++;



                    }
                }



            }
            timer1.Enabled = true;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (filecount == filemax) { filecount = 0; }
            PictureBox p = (PictureBox)panel1.Controls[filecount];
            pictureBox1.Image = p.Image;
            filecount++;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void ImageSlider_Load(object sender, EventArgs e)
        {
           
            }
        }
    }

How to insert ,delete,update and search photo and user(id,name,address and phone no) in SQL Database ?



 ....................Database................
create database demo
CREATE TABLE [dbo].[info] (
    [Id] [int] IDENTITY (1, 1) NOT NULL ,
    [Name] [varchar] (50) NOT NULL,
    [Address] [varchar] (150) NOT NULL,
    [Phone] [varchar] (15) NOT NULL,
    [OriginalPath] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [Photo] [image] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

select * from info
........................................................................................................




 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace Demo_Save_Update_Delete_Search_Photo_Store
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SqlConnection con = new SqlConnection("Data Source=RANJEETKUMAR-PC\\SQLEXPRESS; Initial Catalog=demo; User Id=sa; Password=ranjeet");
    
        private void Form1_Load(object sender, EventArgs e)
        {
            show_detail();

        }
        public void clear()
        {
            textId.Text = "";
            textName.Text = "";
            textAddress.Text = "";
            textPhone.Text = "";
            textPhoto_Path.Text = "";
        }


        public void show_detail()
        {
            con.Open();
            SqlDataAdapter da = new SqlDataAdapter("select * from info", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "info");
            dataGridView1.DataSource = ds.Tables["info"];
            con.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            clear();
        }

        private void SAVE_Click(object sender, EventArgs e)
        {
            byte[] Photo = ReadFile(textPhoto_Path.Text);

            try
            {

                string str = "insert into info (Name,Address,Phone,OriginalPath,Photo) values(@Name,@Address,@Phone,@OriginalPath,@Photo)";
                SqlCommand cmd = new SqlCommand(str, con);
                cmd.Parameters.Add(new SqlParameter("@Name", (object)textName.Text));
                cmd.Parameters.Add(new SqlParameter("@Address", (object)textAddress.Text));
                cmd.Parameters.Add(new SqlParameter("@Phone", (object)textPhone.Text));
                cmd.Parameters.Add(new SqlParameter("@OriginalPath", (object)textPhoto_Path.Text));
                cmd.Parameters.Add(new SqlParameter("@Photo", (object)Photo));
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();
                MessageBox.Show("Saved Successfully");
                show_detail();
            }
            catch
            {
            }
        }

        private void UPDATE_Click(object sender, EventArgs e)
        {
            byte[] Photo = ReadFile(textPhoto_Path.Text);
            try
            {
                string str = "update info set Name=@Name,Address=@Address,Phone=@Phone,OriginalPath=@OriginalPath,Photo=@Photo where Id='" + textId.Text + "'";
                SqlCommand cmd = new SqlCommand(str, con);
                cmd.Parameters.Add(new SqlParameter("@Name", (object)textName.Text));
                cmd.Parameters.Add(new SqlParameter("@Address", (object)textAddress.Text));
                cmd.Parameters.Add(new SqlParameter("@Phone", (object)textPhone.Text));
                cmd.Parameters.Add(new SqlParameter("@OriginalPath", (object)textPhoto_Path.Text));
                cmd.Parameters.Add(new SqlParameter("@Photo", (object)Photo));
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();
                MessageBox.Show("Updated Successfully");
                show_detail();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            OpenFileDialog fl = new OpenFileDialog();
            DialogResult dl = fl.ShowDialog();
            if (dl != DialogResult.Cancel)
            {
                pictureBox1.ImageLocation = fl.FileName;
                textPhoto_Path.Text = fl.FileName;

            }
        }
        byte[] ReadFile(String spath)
        {
            byte[] data = null;
            FileInfo finfo = new FileInfo(spath);
            long numbyts = finfo.Length;
            FileStream fs = new FileStream(spath, FileMode.Open, FileAccess.Read);
            BinaryReader br = new BinaryReader(fs);
            data = br.ReadBytes((int)numbyts);
            return data;


        }

        private void DELETE_Click(object sender, EventArgs e)
        {

            try
            {
                if (textDelete.Text == "")
                {
                    MessageBox.Show("Please enter a valid ID.");
                }
                else
                {
                    con.Open();
                    SqlCommand cmd = new SqlCommand("delete from info where Id='" + textDelete.Text + "'", con);
                    cmd.ExecuteNonQuery();
                    con.Close();

                    MessageBox.Show("Deleted successfully");
                    show_detail();

                    textDelete.Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            string row;
            string row1;
            string row2;
            string row3;
            string row4;
            row = dataGridView1.CurrentRow.Cells["Name"].Value.ToString();
            textName.Text = row;
            row1 = dataGridView1.CurrentRow.Cells["Id"].Value.ToString();
            textId.Text = row1;
            row2 = dataGridView1.CurrentRow.Cells["Address"].Value.ToString();
            textAddress.Text = row2;
            row3 = dataGridView1.CurrentRow.Cells["Phone"].Value.ToString();
            textPhone.Text = row3;
            row4 = dataGridView1.CurrentRow.Cells["OriginalPath"].Value.ToString();
            textPhoto_Path.Text = row4;
            try
            {
                byte[] Photo = (byte[])dataGridView1.Rows[e.RowIndex].Cells["Photo"].Value;
                Image newImage;
                using (MemoryStream ms = new MemoryStream(Photo, 0, Photo.Length))
                {
                    ms.Write(Photo, 0, Photo.Length);
                    newImage = Image.FromStream(ms, true);
                }
                pictureBox1.Image = newImage;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }

        private void textSearch_TextChanged(object sender, EventArgs e)
        {
            if (textSearch.Text == "")
            {
                show_detail();
            }
            else
            {
                try
                {


                    con.Open();
                    SqlDataAdapter da = new SqlDataAdapter("select * from info where Id LIKE '" + textSearch.Text + "%'", con);
                    DataSet ds = new DataSet();
                    da.Fill(ds, "info");
                    dataGridView1.DataSource = ds.Tables["info"];
                    con.Close();
                }


                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }


    }
}







How to change Login password and user name using with SQL database?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace  change_password_and_user name
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        SqlConnection con = new SqlConnection("Data Source=.; Initial Catalog=user; User Id=sa; Password=ranjeet");


       
       
        
        private void button1_Click(object sender, EventArgs e)
        {


             try
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("Select * from check1 where username ='" + textBox1.Text + "'", con);

               
                SqlDataReader dr = cmd.ExecuteReader();
               

                if ((dr.Read()) & textBox2.Text == textBox3.Text & textBox3.Text!="")
                {
                    con.Close();
                    con.Open();
                    string str = "update check1 set username=@username,uhints=@uhints where username='" + textBox1.Text + "'";
                    SqlCommand cmd1 = new SqlCommand(str, con);
                    cmd1.Parameters.Add(new SqlParameter("@username", (object)textBox3.Text));
                    cmd1.Parameters.Add(new SqlParameter("@uhints", (object)textBox8.Text));

                    cmd1.ExecuteNonQuery();

                    MessageBox.Show("User Name change Successfully");
                    Form1 r = new Form1();
                    r.Show();
                    this.Hide();
                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    textBox8.Clear();
                   
                    con.Close();

                      

                   

                }

                else if (textBox2.Text != textBox3.Text)
                {
                    MessageBox.Show("The user name and confirmation user name don not match!");
                 
                    textBox2.Clear();
                    textBox3.Clear();
                  
                }


                else if (textBox1.Text == "" & textBox2.Text == "" & textBox3.Text == "")
                {
                    MessageBox.Show("Please enter old user name ,new user name and confirm user name ");
                  
                }
                else if (textBox2.Text == "" & textBox3.Text == "")
                {
                    MessageBox.Show("Please enter new user name and confirm user name");
                 
                }
                else if (textBox1.Text == "")
                {
                    MessageBox.Show("Please enter old user name");
                 
                }
                else if (textBox2.Text == "")
                {
                    MessageBox.Show("Please enter new user name");
                   
                }

                else if (textBox3.Text == "")
                {
                    MessageBox.Show("Please enter confirm user name");

                }



                else
                {
                    MessageBox.Show("The current password you have entered is not valid!");
                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    con.Close();
                }
              
            }
            catch (Exception exc)
            {


                MessageBox.Show(exc.Message);



            }
            con.Close();
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form1 t = new Form1();
            t.Show();
            this.Hide();
        }

        private void button3_Click(object sender, EventArgs e)
        {

            try
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("Select * from check1 where password ='" + textBox4.Text + "'", con);


                SqlDataReader dr = cmd.ExecuteReader();


                if ((dr.Read()) & textBox5.Text == textBox6.Text & textBox6.Text != "")
                {
                    con.Close();
                    con.Open();
                    string str = "update check1 set password=@password,phints=@phints where password='" + textBox4.Text + "'";
                    SqlCommand cmd1 = new SqlCommand(str, con);
                    cmd1.Parameters.Add(new SqlParameter("@password", (object)textBox6.Text));
                    cmd1.Parameters.Add(new SqlParameter("@phints", (object)textBox7.Text));

                    cmd1.ExecuteNonQuery();

                    MessageBox.Show("Password change Successfully");
                    Form1 r = new Form1();
                    r.Show();
                    this.Hide();
                    textBox4.Clear();
                    textBox5.Clear();
                    textBox6.Clear();
                    textBox7.Clear();
                    con.Close();





                }

                else if (textBox5.Text != textBox6.Text)
                {
                    MessageBox.Show("The passowrd and confirmation password do not match!");

                    textBox5.Clear();
                    textBox6.Clear();

                }


                else if (textBox4.Text == "" & textBox5.Text == "" & textBox6.Text == "")
                {
                    MessageBox.Show("Please enter old password ,new password and confirm password ");

                }
                else if (textBox5.Text == "" & textBox5.Text == "")
                {
                    MessageBox.Show("Please enter new password and confirm user name");

                }
                else if (textBox4.Text == "")
                {
                    MessageBox.Show("Please enter old password");

                }
                else if (textBox5.Text == "")
                {
                    MessageBox.Show("Please enter new password");

                }

                else if (textBox6.Text == "")
                {
                    MessageBox.Show("Please enter confirm password");

                }



                else
                {
                    MessageBox.Show("The current password you have entered is not valid!");
                    textBox4.Clear();
                    textBox5.Clear();
                    textBox6.Clear();
                    con.Close();
                }

            }
            catch (Exception exc)
            {


                MessageBox.Show(exc.Message);



            }
            con.Close();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Form1 t = new Form1();
            t.Show();
            this.Hide();
        }

      
    }
}

How to create a Simple Game ?

 
 '===========================================================
'====   Programmed by:     Er. Ranjeet khune
'====   Email:             ddkhune@gmail.com
'==== 
'==== 
'====   Note:               Send me feedback regarding
'====                       this application
'====
'==== 
'==== 
'===========================================================

#region Using directives;
using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Media;


#endregion
namespace Ranjeet_MindBlowing_Game
{
    public partial class Game : Form
    {
        public Game()
        {
            InitializeComponent();
        }
        int bankroll;
        int[] final = new int[4];
        SoundPlayer spinSound = new SoundPlayer();
        SoundPlayer noWin = new SoundPlayer();
        SoundPlayer win = new SoundPlayer();
        SoundPlayer oraju = new SoundPlayer();
        PictureBox[] choices = new PictureBox[7];
        Random myRandom = new Random();
        const int lemon = 1;
        const int cherry = 2;
        const int orange = 3;
        const int plum = 4;
        const int bell = 5;
        const int star = 6;

        private int NewIndex()
        {
            return (myRandom.Next(6) + 1);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("You ended up with " + Convert.ToString(bankroll) + " dollars.", "Game Over", MessageBoxButtons.OK);
            this.Close();
        }

        private void picChoice1_Click(object sender, EventArgs e)
        {

        }

        private void btnSpin_Click(object sender, EventArgs e)
        {
            if (bankroll == 0)
            {
                MessageBox.Show("Out of Cash!", "Game Over", MessageBoxButtons.OK);
                this.Close();
            }
            bankroll -= 1;
            //******* friend this is coding of Start timers
            timSpin.Enabled = true;
            timStop1.Enabled = true;
            timStop2.Enabled = true;
            timStop3.Enabled = true;
            grpGame.Text = "Spinning ...";
        }

        private void timStop1_Tick(object sender, EventArgs e)
        {
            //  friend    please this is coding of Stop spinning of first display
            timStop1.Enabled = false;
            final[1] = NewIndex();
            pic1.Image = choices[final[1]].Image;
            pic1.Refresh();
        }

        private void timStop2_Tick(object sender, EventArgs e)
        {
            // friend this is coding of Stop spinning of first display
            timStop1.Enabled = false;
            final[1] = NewIndex();
            pic1.Image = choices[final[1]].Image;
            pic1.Refresh();
        }

        private void timStop3_Tick(object sender, EventArgs e)
        {
            int winnings = 0;
            // friend this is coding of Stop spinning of third display
            timStop3.Enabled = false;
            final[3] = NewIndex();
            pic3.Image = choices[final[3]].Image;
            pic3.Refresh();
            timSpin.Enabled = false;
            //  friend khune this is coding of Check for winnings
            if (final[1] == cherry)
            {
                winnings = 2;
                if (final[2] == cherry)
                {
                    winnings = 4;
                    if (final[3] == cherry)
                    {
                        winnings = 6;
                    }
                }
            }
            else if (final[1] == orange && final[2] == orange && final[3] == orange)
            {
                winnings = 10;
            }
            else if (final[1] == plum && final[2] == plum && final[3] == plum)
            {
                winnings = 20;
            }
            else if (final[1] == bell && final[2] == bell && final[3] == bell)
            {
                winnings = 30;
            }
            else if (final[1] == star && final[2] == star && final[3] == star)
            {
                winnings = 50;
            }
            bankroll += winnings;
            if (winnings == 50)
            {
                grpGame.Text = "oraju! Won $50";
                oraju.Play();
            }
            else if (winnings > 0)
            {
                grpGame.Text = "Won $" + Convert.ToString(winnings);
                win.Play();
            }
            else
            {
                grpGame.Text = "Sorry";
                noWin.Play();
            }
            grpGame.Text += " - Bankroll $" + Convert.ToString(bankroll);
        }

        private void timSpin_Tick(object sender, EventArgs e)
        {
            //  friend this is coding of Randomly display pictures
            //  friend  thsis  is coding of play spin sound
            spinSound.Play();
            if (timStop1.Enabled)
            {
                pic1.Image = choices[NewIndex()].Image;
            }
            if (timStop2.Enabled)
            {
                pic2.Image = choices[NewIndex()].Image;
            }
            if (timStop3.Enabled)
            {
                pic3.Image = choices[NewIndex()].Image;
            }
        }

        private void Game_Load(object sender, EventArgs e)
        {
            bankroll = 100; // Start with 100 dollars
            // load images
            picChoice1.Image = Image.FromFile(Application.StartupPath + "\\lemon.wmf");
            picChoice2.Image = Image.FromFile(Application.StartupPath + "\\cherry.wmf");
           picChoice3.Image = Image.FromFile(Application.StartupPath + "\\orange.wmf");
            picChoice4.Image = Image.FromFile(Application.StartupPath + "\\plum.wmf");
            picChoice1.Image = Image.FromFile(Application.StartupPath + "\\ra.wmf");
            picChoice5.Image = Image.FromFile(Application.StartupPath + "\\bell.wmf");
            picChoice6.Image = Image.FromFile(Application.StartupPath + "\\star.wmf");

            //picChoice8.Image = Image.FromFile(Application.StartupPath + "\\ranjeet.wmf");
            //picChoice9.Image = Image.FromFile(Application.StartupPath + "\\ais.wmf");
            //picChoice10.Image = Image.FromFile(Application.StartupPath + "\\rose.wmf");




            // image choices
            choices[1] = picChoice1;
            choices[2] = picChoice2;
            choices[3] = picChoice3;
            choices[4] = picChoice4;
            choices[5] = picChoice5;
            choices[6] = picChoice6;
            ////choices[7] = picChoice7;
            ////choices[8] = picChoice8;
            //choices[9] = picChoice9;
            //choices[10] = picChoice10;


            // Put random pictures in display
            pic1.Image = choices[NewIndex()].Image;
            pic2.Image = choices[NewIndex()].Image;
            pic3.Image = choices[NewIndex()].Image;
            spinSound.SoundLocation = Application.StartupPath + "\\spin.wav";
          
            noWin.SoundLocation = Application.StartupPath + "\\dilwale.wav";
            //noWin.SoundLocation = Application.StartupPath + "\\uhoh.wav";
          
        win.SoundLocation = Application.StartupPath + "\\BOLE MORA KANGNA_0_converted.wav";
          //win.SoundLocation = Application.StartupPath + "\\tada.wav";
             oraju.SoundLocation = Application.StartupPath + "\\oraju.wav";
            btnSpin.Focus();
        }

      
    }
}