Not very sure what you are looking for..but one simple way could be just insert a text box from 'Insert' Menu at a cursor position where you wish to display the code.
Then click and drag to draw the box.
Later you can insert a text into it, right click on the borderline of the box and select Edit text. If you wish to display a programming source code inside this box, use courier new font. The tabs in the source code will get properly indented in there with this font