Home > Language Reference > User Dialog Functions > MsgFrame


The MsgFrame function displays a text frame.


Used to display information at a point in a script without any user intervention.


ret=MsgFrame(<text_frame>, <id_frame> [, <x> , <y>] [, <size>][, <color>])


<text_frame>, string, text to display in the frame. <text_frame> is displayed using current font. The string is automatically displayed in the middle of the frame. If <text_frame> is too long, it is displayed on several lines unless no spaces are included in <text_frame>. You can force a line feed by including \n\ in <text_frame>. To display a number, convert it first to a string using Str$ function (see the example below).

<id_frame>, integer, identifier of the frame. 

, optional, integers, coordinates of the topleft point of the frame. If omitted, the frame is displayed in the middle of the screen. Instead of specifying coordinates, those keywords can be used:

<size>, optional, string, font size (default is 12). 

<color>, optional, integer, text color. De0fault is black. Red is  255, green is 65280, blue is 255 x 65536, white (sum of these three colors): 255 + (255x256) + (255x65536) = 16,777,215. If red, green and blue are the index of each color from 0 to 255, <color> is red+(green*256) + (blue*65536)

Return value

ret, optional integer. If the function succeeds, the return value is 0. If the function fails, the return value is a nonzero value.


When the script ends, all the frames are removed.

You can remove a frame at a point in the script using the RemoveFrame function.

If you want to display the & character, you need to double it:
msgframe("A && B",1)

See also



MsgFrame("Please wait",1) ' Displays the text "Please wait"

MsgFrame("Please wait",1,Center,Center) ' Displays the text "Please wait" in the middle of the screen

MsgFrame("The index is: "+str$(index),1) ' Displays the text "The index is: 3" if the index value is 3