STKX组件实现c#与stk的集成
STK X Tutorial – C# 1
STK X Tutorial - C#
In this exercise you will gain hands-on experience using STK X to embed STK
functionality in a container application created with C#.
NOTE: Except where otherwise noted, the instructions in this tutorial are
applicable whether you are using Visual Studio 2005 or Visual Studio.NET
(2003). All pictures are of the Visual Studio 2005 interface.
CONTENTS
CREATE THE PROJECT.............................................................................................1
ADD THE STK X CONTROLS TO THE TOOLBOX............................................................1
SEND COMMANDS TO STK X ....................................................................................2
ADD ZOOM IN/OUT TO THE MAP CONTROL ................................................................4
RESPOND TO EVENTS RAISED BY STK X....................................................................5
ADD MAP PICKING..................................................................................................8
SET STK X PROPERTIES ..........................................................................................9
Create the project
1) Start Visual Studio.
2) From the File menu, select New, and then Project….
3) Select Visual C# as the Project type and the Windows Application template. Enter a
project name and location of your choice.
4) The Form1.cs windows form is opened in Design mode.
Add the STK X controls to the Toolbox
1) If the Toolbox is not already displayed, select it from the View menu.
2) Go to the General section of the toolbox, and right-click in the toolbox background.
3) In the context menu, select Choose Items… (or Add/Remove Items… if you are
using Visual Studio.NET 2003).
4) In the Choose Toolbox Items dialog (Customize Toolbox in Visual Studio.NET
2003), select the COM Components tab.
5) Check AGI Globe Control 8 and AGI Map Control 8 in the list of controls, and click
OK to close the dialog.
6) T