We study the carrier contribution to the elastic constants in ultrathin films of IV-VI compounds in the presence of a parallel magnetic field on the basis of a new 2D carrier dispersion law. It is found, taking ultrathin films of PbS, PbSc and PbTc as examples, that the carrier contribution to the second and third order elastic constants increases with decreasing film thickness in various oscillatory manners. The magnetic field and the ultrathin structure enhance the numerical values of the same contribution. We have suggested an experimental method of determining the said contribution in ultrathin materials having arbitrary dispersion laws.