About a month ago, this was a huge problem for me. First off, we acquired a third horse this summer and my Arab gelding is quite jealous. Next, through bad luck and sheer clumsiness, I shocked him and myself on the electric fence on about three different occasions. I backed my elbow just close enough to the fence to close the circuit, shocking him while brushing, giving a treat and haltering. After that, the weather got quite cool and very dry and every time I would touch him, I'd shock him with static buildup. I never shocked the other two horses, so I think it had to do with him dragging his feet a bit, building up static. By this time, he wouldn't even come near me :(
I tried everything from putting lotion on my hands or spitting on them to wet them before touching him, to touching metal before touching him, to carrying a bounce sheet in my pocket, to spraying him with coat conditioner every day, and adding flax to his feed. I walked like a chicken when I went down to see him to be sure I don't drag my boots on the ground and build up static. Now that it has snowed and there is some moisture in the air, the problem has stopped. I've been hand feeding him treats for a month to get him more comfortable with me touching him again. He's finally getting better, but what a horrible feeling!