Example #1
0
        private Label CreateLabel(Button sender)
        {
            Label LBL = new Label();

            LBL.Name = "LBL" + sender.Name.Substring(1);

            if (sender.Name == "B_lang")
            {
                LBL.Text = Main.resManager.GetString("User_Settings_Hover_Lang", Main.culInfo);
            }
            else if (sender.Name == "B_fonts")
            {
                LBL.Text = Main.resManager.GetString("User_Settings_Hover_Fonts", Main.culInfo);
            }
            else
            {
                LBL.Text = Main.resManager.GetString("User_Settings_Hover_Password", Main.culInfo);
            }

            LBL.Font      = new Font(Main.GetFont(), 11, FontStyle.Bold);
            LBL.TextAlign = ContentAlignment.MiddleCenter;
            LBL.BackColor = Main.GetColor();
            LBL.ForeColor = Color.White;

            LBL.Height = 28;
            LBL.Width  = sender.Width;
            int pX = sender.Location.X;
            int pY = sender.Location.Y + sender.Height - LBL.Height;

            LBL.Location = new Point(pX, pY);

            return(LBL);
        }
Example #2
0
        private Label Fonts_CreateLabel(string name, int X, int Y)
        {
            Label LBL = new Label();

            LBL.Name      = "LBL_" + name;
            LBL.Location  = new Point(X, Y);
            LBL.BackColor = Color.White;
            LBL.ForeColor = Main.GetColor();
            LBL.Font      = new Font(Main.GetFont(), 14);
            LBL.AutoSize  = true;

            return(LBL);
        }
Example #3
0
        private TextBox Pass_CreateTextBox(string name, int X, int Y, bool isLong)
        {
            TextBox TB = new TextBox();

            TB.Name         = "TB_" + name;
            TB.Width        = isLong ? 397 : 189;
            TB.Font         = new Font(Main.GetFont(), 17);
            TB.Location     = new Point(X, Y);
            TB.PasswordChar = '●';
            TB.BackColor    = Color.White;
            TB.ForeColor    = Color.Black;
            TB.BorderStyle  = BorderStyle.Fixed3D;

            return(TB);
        }
Example #4
0
        void CB_fontStyle_SelectedIndexChanged(object send, EventArgs e)
        {
            ComboBox sender = (ComboBox)send;
            string   font   = sender.Text != "" ? sender.Text : Properties.Settings.Default.Fonts[0];

            Properties.Settings.Default.UI_Font = font;

            Controls["LBL_select"].Font    = new Font(Main.GetFont(), 14);
            Controls["LBL_fontColor"].Font = new Font(Main.GetFont(), 14);
            Controls["LBL_fontStyle"].Font = new Font(Main.GetFont(), 14);

            if (Database_Connector.Update.Settings("UI_Font", font) == 0)
            {
                Database_Connector.Insert.Settings("UI_Font", font);
            }
            Main.RefreshForms();
        }
Example #5
0
        private Label Lang_CreateLabel()
        {
            Label LBL = new Label();

            LBL.Name      = "LBL_LanguageSelection";
            LBL.Font      = new Font(Main.GetFont(), 12, FontStyle.Bold);
            LBL.TextAlign = ContentAlignment.MiddleCenter;
            LBL.ForeColor = Main.GetColor();
            LBL.BackColor = Color.White;
            LBL.Width     = this.Width - B_lang.Width;

            int pX = B_lang.Width;

            LBL.Location = new Point(pX, 40);

            return(LBL);
        }
Example #6
0
 public static void UpdateFonts(Form form)
 {
     foreach (Control c in form.Controls)
     {
         if (c is TextBox || c is DataGridView || c is ListBox)
         {
             c.Font      = new Font(Properties.Settings.Default.Fonts[0], c.Font.Size);
             c.ForeColor = Color.Black;
         }
         else
         {
             c.Font = new Font(Main.GetFont(), c.Font.Size);
             if (c.Name != "bt_Exit" && c.Name != "bt_Back" && c.Name != "bt_Logout")
             {
                 c.ForeColor = Main.GetColor();
             }
         }
     }
     form.Update();
     form.Refresh();
 }
Example #7
0
        private RadioButton Lang_CreateRadioButton(string lang)
        {
            RadioButton RB = new RadioButton();

            RB.Name       = "RB_" + lang.ToLower();
            RB.Text       = lang.ToUpper();
            RB.Font       = new Font(Main.GetFont(), 24, FontStyle.Bold);
            RB.TextAlign  = ContentAlignment.MiddleCenter;
            RB.Size       = new Size(85, 85);
            RB.Appearance = Appearance.Button;
            RB.FlatStyle  = FlatStyle.Flat;

            RB.FlatAppearance.CheckedBackColor = Main.GetColor();
            RB.BackColor = Color.White;
            if (lang.ToLower() == Main.culInfo.Name.Substring(0, 2))
            {
                RB.Checked   = true;
                RB.ForeColor = Color.White;
                RB.FlatAppearance.MouseOverBackColor = Main.GetColor();
            }
            else
            {
                RB.ForeColor = Main.GetColor();
                RB.FlatAppearance.MouseOverBackColor = DefaultBackColor;
            }

            RB.Cursor = Cursors.Hand;
            RB.FlatAppearance.BorderSize = 0;
            RB.Click += Lang_RadioButton_Click;

            int offset = lang == "fr" ? -RB.Width / 2 : RB.Width / 2;
            int pX     = this.Width / 2 + offset;
            int pY     = this.Height / 2 - RB.Height / 2;

            RB.Location = new Point(pX, pY);

            return(RB);
        }
Example #8
0
        private Button Pass_CreateButton(Button sender, string name)
        {
            Button B = new Button();

            B.Name      = "B_" + name.ToLower();
            B.TextAlign = ContentAlignment.MiddleCenter;
            B.Font      = new Font(Main.GetFont(), 14);
            B.Width     = 192;
            B.Height    = 42;
            B.BackColor = Main.GetColor();
            B.ForeColor = Color.White;
            B.FlatStyle = FlatStyle.Flat;
            B.FlatAppearance.BorderSize = 0;
            B.Cursor = Cursors.Hand;
            B.Click += B_confirm_Click;

            int pX = (this.Width - sender.Width) / 2;
            int pY = Controls["TB_newPassword"].Location.Y + Controls["TB_newPassword"].Height + 12;

            B.Location = new Point(pX, pY);

            return(B);
        }