Actually not. Code::Blocks wasn't designed to compile single files, but projects. And there's a feature request about this, but got dismissed as "wontfix".
Now if you want, we could post a poll asking users whether to allow or not compilation of single files.