Exemplo n.º 1
0
        private void Home_Load(object sender, EventArgs e)
        {
            //Clear all the controls at the load of the form
            UIHandler.ClearControl(textBoxName, textBoxPrice, dateTimePickerMfgDate);

            //Populate the DataGridView with data from the database
            this.populateRecords();

            //Set properties for the dataGridView (read-only), column width, cell alignment etc..
            string status = UIHandler.DataGridViewProperties(dataGridViewProducts, this.Width);

            //no errors are identified
            if (!string.IsNullOrEmpty(status))
            {
                MessageBox.Show(status, Common.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //Set the focus on the textBox (Name)
            textBoxName.Focus();
        }
Exemplo n.º 2
0
 private void Home_Resize(object sender, EventArgs e)
 {
     //Normal mode: FormWidth: 700
     //Maximize mode: FormWidth: 1376
     UIHandler.DataGridViewProperties(dataGridViewProducts, this.Width);
 }