The key is to separate two different molecular decisions a B cell makes. One decision is which isotype to express, and that is handled by class switching at the DNA level. A completely separate decision is whether a given heavy chain ends in a water-loving tail (so it can be released) or a fatty membrane-spanning tail (so it stays stuck to the cell surface as the B-cell receptor). That second decision is made on the messenger RNA: the same heavy-chain primary transcript is processed differently depending on which polyadenylation signal is used and which terminal exons are kept, i.e. differential or alternative splicing. Keep the transmembrane exons and you get a membrane-anchored receptor; remove them and use the upstream poly-A site and you get the secreted antibody. Surface charge and glycosylation modify antibodies but do not flip them between bound and secreted states, so they are wrong.
\[\boxed{\text{Differential RNA splicing}}\]