Choose the correctly written sentence.

When we ignored him, Johnny stopped having tantrums.

By ignoring him, Johnny stopped having tantrums.

When ignoring him, Johnny stopped having tantrums.

None of the above