コード例 #1
0
        private void Main_Load(object sender, EventArgs e)
        {
            FillAll();
            toolStripStatusLabel.Text = "Prijavljen: " + DBHandle.GetUserFullName();
            //ustvari slovarja oseb
            var slovarOseb = new Dictionary <long, string>();

            foreach (DataRow row in DBHandle.db.Oseba)
            {
                slovarOseb.Add(Convert.ToInt64(row["ID"]), row["Ime"] + " " + row["Priimek"]);
            }
            var val = "Value";
            var key = "Key";

            dataGridViewTextBoxColumn2.DataSource    = new BindingSource(slovarOseb, null);
            dataGridViewTextBoxColumn2.DisplayMember = val;
            dataGridViewTextBoxColumn2.ValueMember   = key;
            dataGridViewTextBoxColumn3.DataSource    = new BindingSource(slovarOseb, null);
            dataGridViewTextBoxColumn3.DisplayMember = val;
            dataGridViewTextBoxColumn3.ValueMember   = key;
            posojevalecComboBox.DataSource           = new BindingSource(slovarOseb, null);
            posojevalecComboBox.DisplayMember        = val;
            posojevalecComboBox.ValueMember          = key;
            izposojevalecComboBox.DataSource         = new BindingSource(slovarOseb, null);
            izposojevalecComboBox.DisplayMember      = val;
            izposojevalecComboBox.ValueMember        = key;

            var colorString = DBHandle.GetUserColor();

            System.Drawing.Color myColor;
            try
            {
                myColor = System.Drawing.ColorTranslator.FromHtml(colorString);
            }
            catch
            {
                MessageBox.Show("Napaka pri vnosu barve. Uporabljate lahko vse HTML barve.", "Barva", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            this.BackColor = myColor;
        }
コード例 #2
0
ファイル: Settings.cs プロジェクト: fsacer/denarna-posojila
 private void LoginForm_Load(object sender, EventArgs e)
 {
     txtBarva.Text = DBHandle.GetUserColor();
 }