Two ways:
1. After clicking on "Reply to Thread", click on the "Go Advanced" option. From there, enter your code. Then select it all, and click the Code button from the edit toolbar (looks like a hash tag or pound sign).
2. Surround your code with:
[ code ]
...
[ /code ]
but without the spaces