Create Legend 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

Creates a new Theme Legend window tied to the specified Map window. You can issue this statement from the MapBasic window in MapInfo Pro.

For MapInfo Pro versions 5.0 and later, the Create Cartographic Legend statement allows you to create and display cartographic style legends. Refer to the Create Cartographic Legend statement for more information.

Syntax

Create Legend 
	[ From Window window_ID ] 
	[ { Show | Hide } ] 

window_ID is an integer, representing a MapInfo Pro window ID for a Map window.

Description

This statement creates a special floating, Thematic Legend window, in addition to the standard MapInfo Pro Legend window. (To open MapInfo Pro's standard Legend window, use the Open Window Legend statement.)

The Create Legend statement is useful if you want the Legend of a Map window to always be visible, even when the Map window is not active. Also, this statement is useful in "Integrated Mapping" applications, where MapInfo Pro windows are integrated into another application, such as a Visual Basic application. For information about Integrated Mapping, see the MapBasic User Guide.

If you include the From Window clause, the new Theme Legend window is tied to the window that you specify; otherwise, the new window is tied to the most recently used Map.

If you include the optional Hide keyword, the window is created in a hidden state. You can then show the hidden window by using the Set Window...Show statement.

After you issue the Create Legend statement, determine the new window's integer ID by calling WindowID( 0 ). Use that window ID in subsequent statements (such as the Set Window statement).

The new Theme Legend window is created according to the parent and style settings that you specify through the Set Next Document statement.

See Also:

Create Cartographic Legend statement, Open Window statement, Set Next Document statement, Set Window statement