How can a one currency gain against the other if it is pegged aginst it? I have been reading about when the Swiss national Bank decided it would no longer peg its currency against the euro and this caused massive turmoil in the markets.

But my question was before this the Swiss Franc was pegged against the euro. So how is it the you could have place a bet the euro would rise against the swiss franc when the Swiss Franc was pegged against the euro . Surely they would rise by the same amout.
Strictly speaking it was not a peg but a cap: the Swiss National Bank said it would sell unlimited Swiss Francs at the rate of 1.2 CHF : 1 EUR.  

You could have bet that the Euro would rise against the Swiss franc by borrowing some Swiss Francs and selling them for Euros, and then taking any profit or loss by unwinding the transaction.  

If for example you had bought Euros with Swiss Francs in May 2012 and sold back in May 2013, this might have been profitable (at least before transaction costs), but if you had held past 15 January 2015 you would have made a loss when the cap was withdrawn.