  We investigate the scattering of strahl electrons by microinstabilities as a
mechanism for creating the electron halo in the solar wind. We develop a
mathematical framework for the description of electron-driven
microinstabilities and discuss the associated physical mechanisms. We find that
an instability of the oblique fast-magnetosonic/whistler (FM/W) mode is the
best candidate for a microinstability that scatters strahl electrons into the
halo. We derive approximate analytic expressions for the FM/W instability
threshold in two different $\beta_{\mathrm c}$ regimes, where $\beta_{\mathrm
c}$ is the ratio of the core electrons' thermal pressure to the magnetic
pressure, and confirm the accuracy of these thresholds through comparison with
numerical solutions to the hot-plasma dispersion relation. We find that the
strahl-driven oblique FM/W instability creates copious FM/W waves under
low-$\beta_{\mathrm c}$ conditions when $U_{0\mathrm s}\gtrsim 3w_{\mathrm c}$,
where $U_{0\mathrm s}$ is the strahl speed and $w_{\mathrm c}$ is the thermal
speed of the core electrons. These waves have a frequency of about half the
local electron gyrofrequency. We also derive an analytic expression for the
oblique FM/W instability for $\beta_{\mathrm c}\sim 1$. The comparison of our
theoretical results with data from the \emph{Wind} spacecraft confirms the
relevance of the oblique FM/W instability for the solar wind. The whistler
heat-flux, ion-acoustic heat-flux, kinetic-Alfv\'en-wave heat-flux, and
electrostatic electron-beam instabilities cannot fulfill the requirements for
self-induced scattering of strahl electrons into the halo. We make predictions
for the electron strahl close to the Sun, which will be tested by measurements
from \emph{Parker Solar Probe} and \emph{Solar Orbiter}.
