A common trend I see here in Gambling Discussion are people making threads complaining how they lost money, etc while playing. I bet they were not complaining while they were winning.
There's only on way to prevent gambling going out of hand and it also applies to other areas of life... Create a budget AND stick to it.
Set a monthly limit, a fund for everything entertainment-related. Use that up within a month or not, it gets topped up monthly and that's the only money you can use for gambling.