We report control of magnetic anisotropy in epitaxial (Ga,Mn)As by anisotropic strain relaxation in patterned structures. The strain in the structures is characterized using reciprocal space mapping by x-ray techniques. The magnetic anisotropy before patterning of the layer, which shows biaxial easy axes along [100] and [010], is replaced by a hard axis in the direction of large elastic strain relaxation and a uniaxial easy axis in the direction where pseudomorphic conditions are retained.