To prevent slouching, you can make use of a belt or a Thera-band. A Thera-band is described as a long piece of stretch material mostly found at fitness supply stores. Use the belt or band and fasten it around your waist, then make it snug. Find more details on http://www.ehow.com/how_5038527_prevent-slouching.html.
Pilates is great. Core strength is critical to good posture. If you workout, work on your traps and shoulder, and especially abs (core). Pilates or Yoga is probably best though. Also, when you start to slouch, focus on taking deep breaths. Take about 15 deep breaths. This will cause you to open up your chest and pull your shoulders back, plus it's good for you.