Bound states in waveguides and bent quantum wires. II. Electrons in quantum wires