Close Window statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Closes or hides a window. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Close Window window_spec [ Interactive ] 

window_spec is a window name (e.g., Ruler), a window code (e.g., WIN_RULER), or an integer window identifier.

Description

The Close Window statement closes or hides a MapInfo Pro window.

To close a document window (Map, Browser, Layout, Graph), specify an integer window identifier as the window_spec parameter. You can obtain integer window identifiers through the FrontWindow() function and the WindowID() function.

To close a special MapInfo Pro window, specify one of the window names from the table below as the window_spec parameter. You can identify a special window by name (e.g., Ruler) or by code (e.g., WIN_RULER).

To close an adornment window, specify the window ID of the adornment as determined by the MapperInfo() function.

The following table lists the available window_spec values:

value Window Description
Help The Help window (WIN_HELP).
Info The Info Tool window (WIN_INFO).
LayerControl The Layer Control window (WIN_LAYER_CONTROL). In an integrated mapping application, this refers to the modal version.
Legend The Theme Legend window (WIN_LEGEND).
MapBasic The MapBasic window (WIN_MAPBASIC).
Message The Message window used by the Print statement (WIN_MESSAGE).
MoveMapTo The Move Map To window (WIN_MOVE_MAP_TO).
Ruler The Ruler tool window (WIN_RULER).
Statistics The Statistics window (WIN_STATISTICS).
TableList The Table List window (WIN_TABLE_LIST). In an integrated mapping application, this refers to the modal version.
Note: The window IDs for Table List, Layer Control, and Move Map To windows are ignored by the Set Window statement, WindowInfo() function, and WindowID() function.

Saving Themes and Cosmetic Objects

The user may want to save thematic layers or cosmetic objects before closing the window. To prompt the user to save themes or cosmetic objects, include the Interactive keyword.

If you omit the Interactive keyword, the Close Window statement will not prompt the user to save themes or cosmetic objects. If you include the Interactive keyword, dialog boxes will prompt the user to save themes and/or cosmetic objects, if such prompts are appropriate. (The user will not be prompted if the window has no themes or cosmetic objects.)

Example

Close Window Legend

See Also:

Open Window statement, Print statement, Set Window statement