Electric field-induced strain control of magnetism in in-plane and out-of-plane magnetized thin films