 |
|
Using MapInfo Callbacks Manager with Microsoft® Visual Basic
Do the following:
- Run Visual Basic;
- Open existing project or create new one;
- Right Click on Toolbox and select "Components..." item in pop-up menu;
- Make "Controls" page active In "Components" dialog;
- Select MapInfo Callbacks Manager ActiveX from the list and press <space> (selected item will be now checked) and then press OK to close dialog;
- Select Component MapInfoCallBacksManagerX from ToolBox and place it on the form;
- Write Event handlers for the following events:
|
Event...
|
...occurs when...
|
|
OnLineTool
|
Line custom tool was used;
|
|
OnPolylineTool
|
Polyline custom tool was used;
|
|
OnRegionTool
|
Region custom tool was used;
|
|
OnRectTool
|
Rectangle custom tool was used;
|
|
OnEllipseTool
|
Ellipse custom tool was used;
|
|
OnPushButton
|
custom PushButton was used;
|
|
OnToggleButton
|
custom ToggleButton was used;
|
|
OnSymbolTool
|
Symbol custom tool was used;
|
|
OnSetStatusText
|
MapInfo status bar text was changed;
|
|
OnSetStatusItemsCount
|
transfer number of Panels to MapInfo Status Bar;
|
|
OnSetStatusItemText
|
transfer Text of Panel with ItemNo index to MapInfo Status Bar;
|
|
OnWindowContentsChanged
|
contents of MapInfo's child window were changed.
|
|
Note:
Don't forget to set MapInfo property correctly:
...
Dim MI As Object
...
Private Sub Form_Load()
Set MI = CreateObject("MapInfo.Application")
MapInfoCallBacksManagerX1.MapInfo = MI
|
|