We present a new approach to engineer the band structure of carbon nanotube field-effect transistors via selected area chemical gating. By exposing the center part or the contacts of the nanotube devices to oxidizing or reducing gases, a good control over the threshold voltage and subthreshold swing has been achieved. Our experiments reveal that NO2 shifts the threshold voltage higher while NH3 shifts it lower for both center-exposed and contact-exposed devices. However, modulations to the subthreshold swing are in opposite directions for center-exposed and contact-exposed devices: NO2 lowers the subthreshold swing of the contact-exposed devices, but increases that of the center-exposed devices; In contrast, NH3 reduces the subthreshold swing of the center-exposed devices, but increases that of the contact-exposed devices. A model has been developed based on Langmuir isotherm, and the experimental results can be well explained.