Control of the wave function of confined microcavity polaritons is demonstrated experimentally and theoretically by means of tailored resonant optical excitation. Three dimensional confinement is achieved by etching mesas on top of the microcavity spacer layer. Resonant excitation with a continuous-wave laser locks the phase of the discrete polariton states to the phase of the laser. By tuning the energy and momentum of the laser, we achieve precise control of the momentum pattern of the polariton wave function. This is an efficient and direct way for quantum control of electronic excitations in a solid.