Bandgap engineering and shape control are important and advantageous for potential applications involving colloidal ZnO nanocrystals. Here we demonstrate the syntheses of high quality alloyed CdxZn1-xO nanocrystals with well-defined shapes, from faceted particles to tetrapods and ultrathin nanowires. By comparing the optical bandgaps of the pure ZnO, CdxZn1-xO and MgxZn1-xO nanocrystals with various dimensions, we conclude that bandgap engineering of colloidal ZnO nanocrystals via cadmium alloying effectively narrows the bandgaps. Our study may shed light on the design and syntheses of colloidal alloyed oxide nanocrystals with controlled band structures and shapes.