We report a theoretical investigation of the phenomenon of the formation of patterns transverse to the tunneling current in resonant-tunneling double-barrier heterostructures. Such patterns arise in heterostructures with an intrinsic bistability of the current-voltage characteristic. The patterns are characterized by a nonuniform distribution of resonant electrons in the quantum-well layer and, consequently, a nonuniform tunneling current density through the heterostructure. Patterns exist for coherent and for sequential mechanisms of the resonant tunneling. Possible types of stationary patterns depend on the applied voltage, and can be controlled by conditions on the edges of the heterostructure, In fact, the patterns are two or three dimensional in character, since the nonuniform electron distributions induce a complex configuration of the electrostatic potential in barrier regions. In addition to stationary patterns, moving patterns are considered. They describe the switching of the heterostructure from one uniform state to another.