Пример #1
0
        // Enables the user to add a genre //
        private void btn_AddGenre_Click(object sender, EventArgs e)
        {
            string i;

            RSave = true;
            for (i = My_Dialogs.InputBox("Please enter the 'Genre Title'."); i == ""; i = My_Dialogs.InputBox("Please enter the 'Genre Title'."))
            {
                MessageBox.Show("You must give the 'Genre' a title!");
            }
            if (i != "")
            {
                Int_SetupNumberofGenre++;
                Int_ShowGenreNumber = Int_SetupNumberofGenre;
                if (Setup_Media_Library != null)
                {
                    Array.Resize <ListBox>(ref Setup_Media_Library, Int_SetupNumberofGenre + 1);
                }
                Setup_Media_Library[Int_SetupNumberofGenre - 1] = new ListBox();
                Setup_Media_Library[Int_SetupNumberofGenre - 1].Items.Add(i);
                AddToGList(Int_ShowGenreNumber);
                btn_NextGenre.Enabled     = false;
                btn_PreviousGenre.Enabled = true;
                btn_DeleteGenre.Enabled   = true;
            }
        }
Пример #2
0
        private void btn_Genre_Add_Click(object sender, EventArgs e)
        {
            string new_genre_name;

            new_genre_name = My_Dialogs.InputBox("Please enter the new 'Genre Title'.");

            //trap user in endless onslaught of data input, until they give up and enter text
            while ((btn_Genre_Add.DialogResult == DialogResult.Cancel) || (new_genre_name == ""))
            {
                MessageBox.Show("You must give the Genre a title!");
                new_genre_name = My_Dialogs.InputBox("Please enter the new 'Genre Title'.");
            }
            //if string isnt empty and the ok is pressed add new genre
            if ((new_genre_name.Length > 0) && (btn_Genre_Add.DialogResult == DialogResult.OK))
            {
                MessageBox.Show("You must give the Genre a title!");
            }

            //add a genre
            num_genres++;
            //clear current playlist & title
            lst_Playlist.Items.Clear();
            txt_Genre_Title2.Clear();

            //enter new title from new index
            txt_Genre_Title2.Text = new_genre_name;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            double CreditCostInput;

            CreditCostInput = Convert.ToInt32(My_Dialogs.InputBox("Enter the cost of credit: "));

            textbox_CreditCost.Text = CreditCostInput.ToString();
        }
Пример #4
0
        private void configureToolStripMenuItem_Click(object sender, EventArgs e)
        {
            delay = (My_Dialogs.InputBox("Please enter the 'Delay Value' you require, 1000 is equal to a 1 second delay. At present the Delay Value is " + delay + "."));
            num   = Convert.ToInt16(delay);

            if (num < 500)
            {
                num   = 500;
                delay = "500";
            }
            timerPress.Interval = num;
        }
Пример #5
0
 private void configureMenu_Click(object sender, EventArgs e)
 {
     try //Try and catch method to catch exception from crashing program
     {
         int userInput = Convert.ToInt16(My_Dialogs.InputBox("Please enter the interval delay value for the timer! 1000 is equal to a 1 second delay. Cannot be below 700. The current delay value is" + this.Int_Interval_Required + "."));
         if (userInput < 700)                        //Method used to allow user to change the interval of the timer
         {
             userInput = 700;                        //Does not allow the user to change it below 700
         }
         this.ButtonPressTimer.Interval = userInput; //Changes the button interval timer to that of which the user changes it too
         this.Int_Interval_Required     = userInput;
     }
     catch { }
 }
Пример #6
0
 private void strip_Configure_Click(object sender, EventArgs e) // If the menu strip Open is clicked then;
 {
     try
     {
         int delay = Convert.ToInt16(My_Dialogs.InputBox("Enter a delay value you require, 1000 is equal to 1 second meaning 5000 is 5 seconds. The current delay value is " + this.Int_Interval_Required + ".")); // Opens the dialog for the delay set
         if (delay < 500)                                                                                                                                                                                          // If the delay is less than 500
         {
             delay = 500;                                                                                                                                                                                          //Sets the delay to 500
         }
         this.Within_Timer.Interval = delay;                                                                                                                                                                       // Sets Within_Timer.Interval as delay
         this.Int_Interval_Required = delay;                                                                                                                                                                       // Sets Int_Interval_Required as delay
     }
     catch { }
 }
        private void button_Reset_Click(object sender, EventArgs e)
        {
            string ResetCoins;

            ResetCoins = ((label_TwoPoundCount.Text) = (label_TwoPoundTotal.Text) = (label_OnePoundCount.Text) = (label_OnePoundTotal.Text) = (label_FiftyPenceCount.Text) = (label_FiftyPenceTotal.Text) = (label_TwentyPenceCount.Text) = (label_TwentyPenceTotal.Text) = (label_TenPenceCount.Text) = (label_TenPenceTotal.Text) = (label_FivePenceCount.Text) = (label_FivePenceTotal.Text) = (label_TwoPenceCount.Text) = (label_TwoPenceTotal.Text) = (label_OnePenceCount.Text) = (label_OnePenceTotal.Text) = "0");

            string ResetTotal;

            ResetTotal = ((textbox_CreditCost.Text) = (textbox_CreditTotal.Text) = (textbox_Total.Text) = (textbox_TotalPence.Text) = "0");

            double CreditCostInput;

            CreditCostInput = Convert.ToInt32(My_Dialogs.InputBox("Enter the cost of credit: "));

            textbox_CreditCost.Text = CreditCostInput.ToString();
        }
Пример #8
0
 private void btn_Credit_Click(object sender, EventArgs e)
 {
     int.TryParse(My_Dialogs.InputBox("Please enter the credit: "), out creditcost); // Opens a inputbox from the My_Dialogs class asking for the Cost per credit
     lbl_Costcredit.Text = creditcost.ToString();                                    //Sets the label to the inputted cost per credit
 }
Пример #9
0
 private void configureToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //Allows the user to change the timer interval
     intervalRequired = Convert.ToInt32(My_Dialogs.InputBox("Please enter the delay value you require. 1000 is equal to 1 second delay. The delay is currently at " + intervalRequired));
     timer1.Interval  = intervalRequired;
 }
 private void configureToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //Allow user to set the interval
     intIntervalRequired = Convert.ToInt32(My_Dialogs.InputBox("Please enter the 'Delay Value' which is for every 1000 is equal to 1 second. At present the Delay value is 500."));
 }