With HK CodeBlock, you can add various features to code blocks. You must use the title feature to use the collapse feature. You can collapse the code block like this ...
Download Code::Blocks and install it ( http://www.codeblocks.org/) Launch Code::Blocks and go to the Setting --> Compiler and debugger menu Create a new compiler ...