日期:2013-03-21  浏览次数:20427 次

这是 我在.net环境中调用mapx5.0控件 的一次test,前几次网上没有发现这方面的文章,所以自己
把几个代码拿出 来:这里有些代码是自动生成的,但只要把几篇文章的代码直接拷贝到工程里 就
能直接运行的。

using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

namespace gistestbymyself
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class FrmMain : System.Windows.Forms.Form
{

#region 私有变量的声明
private AxMapXLib.AxMap axMap1;
private AxMapXLib.AxMap axMap2;

private double zoom;
private double centerx;
private double centery;
#endregion

#region Windows 窗体上拖入窗体的控件
/// <summary>
///
/// 窗体信息。
/// </summary>





private System.Windows.Forms.ToolBar toolBar2;
private System.Windows.Forms.ToolBarButton tbfangda;
private System.Windows.Forms.ToolBarButton tbbianxiao;
private System.Windows.Forms.ToolBarButton tbmanyou;
private System.Windows.Forms.ToolBarButton tbbiaozhu;
private System.Windows.Forms.ToolBarButton tbjuli;
private System.Windows.Forms.ToolBarButton tbshuaxin;
private System.Windows.Forms.ToolBarButton tbxiangxi;
private System.Windows.Forms.ToolBarButton tbzuiduan;
private System.Windows.Forms.ToolBarButton tbmianji;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolBarButton tbxuanze;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem mutuceng;
private System.Windows.Forms.ContextMenu comu;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.ContextMenu comu1;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem menuItem9;
private System.Windows.Forms.ToolBarButton tbtianjiafuhao;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.MenuItem menuItem11;
private System.Windows.Forms.MenuItem menuItem12;
private System.Windows.Forms.MenuItem menuItem13;
private System.Windows.Forms.MenuItem menuItem14;
private System.Windows.Forms.MenuItem menuItem15;
private System.Windows.Forms.MenuItem menuItem16;
private System.Windows.Forms.MenuItem menuItem17;
private System.Windows.Forms.MenuItem menuItem18;
private System.Windows.Forms.MenuItem menuItem19;
private System.Windows.Forms.MenuItem menuItem20;
private System.Windows.Forms.MenuItem menuItem21;
private System.Windows.Forms.MenuItem menuItem22;
private System.Windows.Forms.MenuItem menuItem23;
private System.Windows.Forms.MenuItem menuItem24;
private System.Windows.Forms.MenuItem menuItem25;
private System.Windows.Forms.MenuItem menuItem26;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.MenuItem menuItem27;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton tbadddian;
private System.Windows.Forms.ToolBarButton tbaddxian;
private System.Windows.Forms.ToolBarButton tbaddquxian;
private System.Windows.Forms.ToolBarButton tbaddqumian;
private System.Windows.Forms.ToolBarButton tbshezhi;
private System.Windows.Forms.ToolBarButton tbline;
private System.Windows.Forms.MenuItem menuItem28;
private System.Windows.Forms.MenuItem menuItem29;
private System.Windows.Forms.MenuItem menuItem30;
private System.Windows.Forms.MenuItem menuI