private void btnAgregar_Click(object sender, EventArgs e)
        {
            EdicionEspecialidades f = new EdicionEspecialidades();

            f.lblID.Visible             = false;
            f.txbIDEspecialidad.Visible = false;
            f.lblEspecialidad.Margin    = new Padding(3, 25, 3, 0);
            f.txbEspecialidad.Margin    = new Padding(3, 15, 3, 15);
            f.btnAgregar.Location       = new Point(54, 146);
            f.btnCancelar.Location      = new Point(174, 146);
            f.ShowDialog();
            CargarDatos();
        }
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(dtgvDatos.Rows.Count.ToString()) <= 0)
            {
                MessageBox.Show("Actualmente no existe ningún registro", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (MessageBox.Show("Desea editar el registro seleccionado?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    EdicionEspecialidades f = new EdicionEspecialidades();

                    //Sincronizando interfaz gráfica con registro seleccionado
                    //(Muestra los datos del registro a editar)
                    f.txbIDEspecialidad.Text = dtgvDatos.CurrentRow.Cells["idespecialidad"].Value.ToString();
                    f.txbEspecialidad.Text   = dtgvDatos.CurrentRow.Cells["especialidad"].Value.ToString();
                    f.ShowDialog();
                    CargarDatos();
                }
            }
        }