Unfortunately there is no way to stop this. There are ways to make it harder but then you are spending much more time trying to prevent theft when the people who really want to steal it are still going to.
In addition, some people like to see how your work has been coded. I don't like buying things unless I see the code first. But if someone uses theft prevention methods that essentially scrambles the code, I won't buy it unless I really really want it.
Some authors don't like providing a live preview as to keep people from stealing their work but in the end, the live preview generates more sales than you lose by theft.
If you would still like to try some form of prevention, try these for starters.
I personally have custom 404 and 403 error pages setup on my hosting server because people that use programs to rip sites will generate tons of errors. As soon as I see a flood coming in from a user agent that isn't a search engine, I block the IP for at least 24 hours. You should also keep your directories protected, etc.
Hope this helps!