A device for improving the function of a heart valve comprises: a support member formed from a shape memory material, and a restraining member providing a restraining action on a course of the support member. The support member may abut one side of the valve conforming to the shape of the valve annulus upon said shape memory material assuming an activated shape while the restraining member restrains the course of the support member. The restraining action is removable for allowing the support member to assume a desired, altered course. The restraining member may be biodegradable to be degraded within a patient or may be detachable from the support member to be withdrawn. The support member according to another embodiment presents a shape change in that an increased cross-section is associated with a shortened length of the support member. The support member according to yet another embodiment has a first and a second activated shape.