Tunable electrostatic interactions in thin films from (C-co-D)-b-B-b-A-b-B-b-(C-co-D)-type pentablock quaterpolymers featuring hydrophobic end blocks as well as pH-responsive and hydrophilic midblocks allow controlling their morphology both by the choice of the pH value during film preparation and the solvent polarity during solvent vapor swelling. The morphological changes were characterized using grazing-incidence small-angle X-ray scattering, and the data analysis was carried out on the basis of simulations of two-dimensional scattering patterns. Dry films prepared at low and at high pH values feature either weakly ordered spheres or totally lack order, respectively. Swelling the former films in water vapor triggers an order-to-disorder transition, which is reversed upon drying, whereas films prepared at a high pH value remain disordered. Upon swelling in toluene vapor, the morphology of films prepared at a low pH value is stable, whereas the ones prepared at a high pH value microphase-separate into a spherical morphology.