We present a theoretical study of the electron states in a quantum well with finite barrier height in a magnetic field applied parallel to the quantum well. For large electron mass mismatch between the quantum well and the barrier, we found the surprising result that the electron energy for zero wave vector decreases with decreasing well width and the energy spectrum has a local minimum at a non-zero wave vector. The influence of well depth, mass ratio and magnetic field are investigated.