Esempio n. 1
0
        private void Word_MouseDown(object sender, MouseEventArgs e)
        {
            C_LinkButton c_LinkButton = sender as C_LinkButton;

            if (c_LinkButton.Text == "")
            {
                return;
            }

            int wordIndex;

            wordIndex  = Controls_WordValue.FindIndex(word => word.TabIndex == c_LinkButton.TabIndex);
            wordIndex += PageLength * (CurrentPage - 1);
            ChangeWord cw = new ChangeWord(AllWords[wordIndex]);

            cw.ShowDialog();
        }
Esempio n. 2
0
        private void Var_MouseDown(object sender, MouseEventArgs e)
        {
            C_LinkButton answer = sender as C_LinkButton;

            if (answer.Text == RightAnswer)
            {
                RightAnswersCount++;
            }
            else
            {
                WrongAnswersCount++;
            }

            right_val.Text = RightAnswersCount.ToString();
            wrong_val.Text = WrongAnswersCount.ToString();

            GetNewWord();
        }
Esempio n. 3
0
        public static Color ActiveColor     = Color.FromArgb(53, 182, 185);  // кнопки на шапке, подсветка таблицы
        //*/

        /*
         * public static Color HeaderBackColor = Color.FromArgb(21, 25, 28); //шапка
         * public static Color HeaderForeColor = Color.FromArgb(154, 167, 180); //шрифт на шапке
         * public static Color HeaderBackLight = Color.FromArgb(80, 91, 105); // подсветка на шапке
         * public static Color TableBackColor = Color.FromArgb(243, 245, 252); // главный фон
         * public static Color TableForeColor = Color.FromArgb(80, 91, 105); //подсветка при наведении на активные элементы / шрифт текста на главном фоне
         * public static Color ActiveColor = Color.FromArgb(234, 76, 137); // кнопки на шапке, подсветка таблицы
         * //*/

        public static void SetColors(Form form)
        {
            form.BackColor = HeaderBackColor;

            foreach (Control item in form.Controls)
            {
                if ((string)item.Tag == "table")
                {
                    item.BackColor = TableBackColor;
                    item.ForeColor = TableForeColor;
                }
                else
                {
                    item.BackColor = HeaderBackColor;
                    item.ForeColor = HeaderForeColor;
                }
            }

            foreach (Control item in form.Controls)
            {
                if (item.GetType() == typeof(C_LinkButton))
                {
                    C_LinkButton LinkButton = item as C_LinkButton;
                    if ((string)LinkButton.Tag == "table")
                    {
                        LinkButton.Backlight = ActiveColor;
                        LinkButton.ForeColor = TableForeColor;
                    }
                    else
                    {
                        LinkButton.Backlight = HeaderBackLight;
                        LinkButton.ForeColor = ActiveColor;
                    }
                }
                else if (item.GetType() == typeof(C_VidableButton))
                {
                    C_VidableButton VidableButton = item as C_VidableButton;
                    if ((string)VidableButton.Tag == "table")
                    {
                        VidableButton.Light = ActiveColor;
                    }
                    else
                    {
                        VidableButton.Light = HeaderBackLight;
                    }
                    VidableButton.Opacity = 0.1f;
                }
                else if (item.GetType() == typeof(C_RadioButton))
                {
                    C_RadioButton RadioButton = item as C_RadioButton;
                    if ((string)RadioButton.Tag == "table")
                    {
                        RadioButton.Backlight = ActiveColor;
                        RadioButton.ForeColor = TableForeColor;
                    }
                    else
                    {
                        RadioButton.Backlight = HeaderBackLight;
                        RadioButton.ForeColor = ActiveColor;
                    }
                }
                else if (item.GetType() == typeof(C_CheckButton))
                {
                    C_CheckButton CheckButton = item as C_CheckButton;
                    if ((string)CheckButton.Tag == "table")
                    {
                        CheckButton.ActiveColor   = ActiveColor;
                        CheckButton.InactiveColor = ChangeBrightness(20, TableForeColor);
                    }
                    else
                    {
                        CheckButton.ActiveColor   = HeaderBackLight;
                        CheckButton.InactiveColor = ChangeBrightness(-20, TableForeColor);
                    }
                }
                else if (item.GetType() == typeof(C_Background))
                {
                    C_Background Background = item as C_Background;
                    Background.TopColor  = HeaderBackColor;
                    Background.BackColor = TableBackColor;
                }
            }
        }