From Wiktionary, the free dictionary
Named after the small cylindrical or hexagonal cases in which medicinal pills used to be sold.
pillbox hat (plural pillbox hats)
- A small hat, usually worn by women, with a flat crown, straight, upright sides, and no brim.