if you are talking about Mach3, a Label with Content File will Show you the filename of loaded program.
i do not know about a possibilty to Show only the first line of gcode, except your create a VBScript witch is
used every time you load a new file, this will only work with a button on Screen, not with Standard menue load file.