We present a computational study of the crystal structure and electric polarization of strained wurtzite III-V nitrides and II-VI oxides, performed in the context of density functional theory and the Berry phase method. The main goal is to investigate the degree to which the lattice parameters, piezoelectric polarization, and piezoelectric constant can be affected by compressive uniaxial strain along the hexagonal c-axis. We show that imposing such strain enhances the piezoelectric response, with both polarization and piezoelectric coefficient increasing from their equilibrium values. The internal parameter of the wurtzite structure also increases with uniaxial strain and eventually becomes equal to 0.5, resulting in a phase transition into the layered hexagonal structure. Furthermore, we discuss the physical origin behind the enhanced piezoelectricity, showing that the enhancement is caused by a strong increase in the response of the internal parameter to strain.