国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

c#中調用mapx5.0(一)

2024-07-21 02:19:05
字體:
來源:轉載
供稿:網友
這是 我在.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 menuitem31;
private system.windows.forms.menuitem menuitem32;
private system.windows.forms.menuitem menuitem33;
private system.windows.forms.menuitem menuitem34;
private system.windows.forms.menuitem menuitem35;
/// <summary>
/// 必需的設計器變量。
/// </summary>
private system.componentmodel.container components = null;

#endregion

#region frmmain類的初始化和form_load時發生時的動作

public frmmain()
{
//
// windows 窗體設計器支持所必需的
//
initializecomponent();

//
// todo: 在 initializecomponent 調用后添加任何構造函數代碼
//
this.zoom=axmap1.zoom; //取得初始化時的地圖比例
this.centerx=axmap1.centerx;
this.centery=axmap1.centery; //取得初始化時的地圖坐標,供刷新時使用

axmap1.createcustomtool(10,mapxlib.tooltypeconstants.mitooltypepoly,mapxlib.cursorconstants.microsscursor,null,null,false);
//創建距離工具

axmap1.createcustomtool(11,mapxlib.tooltypeconstants.mitooltypepolygon,mapxlib.cursorconstants.microsscursor,null,null,false);
//創建面積工具



}
//*********************************
private void form1_load(object sender, system.eventargs e)
{

[email protected]"d:/..../china.gst";

axmap2.geoset= directory.getcurrentdirectory()+ @"/..../*.gst";

axmap1.titletext="中國";
axmap2.titletext="***";
}

#endregion
//*****************************

#region windows 窗體設計器生成的代碼
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.dispose();
}
}
base.dispose( disposing );
}


private void initializecomponent()
{
system.resources.resourcemanager resources = new system.resources.resourcemanager(typeof(frmmain));
this.axmap1 = new axmapxlib.axmap();
this.axmap2 = new axmapxlib.axmap();
this.toolbar2 = new system.windows.forms.toolbar();
this.tbxuanze = new system.windows.forms.toolbarbutton();
this.tbfangda = new system.windows.forms.toolbarbutton();
this.tbbianxiao = new system.windows.forms.toolbarbutton();
this.tbmanyou = new system.windows.forms.toolbarbutton();
this.tbbiaozhu = new system.windows.forms.toolbarbutton();
this.tbtianjiafuhao = new system.windows.forms.toolbarbutton();
this.tbjuli = new system.windows.forms.toolbarbutton();
this.tbmianji = new system.windows.forms.toolbarbutton();
this.tbshuaxin = new system.windows.forms.toolbarbutton();
this.tbxiangxi = new system.windows.forms.toolbarbutton();
this.tbzuiduan = new system.windows.forms.toolbarbutton();
this.label1 = new system.windows.forms.label();
this.mainmenu1 = new system.windows.forms.mainmenu();
this.menuitem1 = new system.windows.forms.menuitem();
this.menuitem20 = new system.windows.forms.menuitem();
this.menuitem21 = new system.windows.forms.menuitem();
this.menuitem22 = new system.windows.forms.menuitem();
this.menuitem23 = new system.windows.forms.menuitem();
this.menuitem24 = new system.windows.forms.menuitem();
this.menuitem25 = new system.windows.forms.menuitem();
this.menuitem26 = new system.windows.forms.menuitem();
this.menuitem2 = new system.windows.forms.menuitem();
this.menuitem3 = new system.windows.forms.menuitem();
this.menuitem29 = new system.windows.forms.menuitem();
this.menuitem28 = new system.windows.forms.menuitem();
this.menuitem27 = new system.windows.forms.menuitem();
this.menuitem15 = new system.windows.forms.menuitem();
this.menuitem32 = new system.windows.forms.menuitem();
this.menuitem31 = new system.windows.forms.menuitem();
this.mutuceng = new system.windows.forms.menuitem();
this.menuitem30 = new system.windows.forms.menuitem();
this.menuitem16 = new system.windows.forms.menuitem();
this.menuitem10 = new system.windows.forms.menuitem();
this.menuitem11 = new system.windows.forms.menuitem();
this.menuitem12 = new system.windows.forms.menuitem();
this.menuitem13 = new system.windows.forms.menuitem();
this.menuitem14 = new system.windows.forms.menuitem();
this.menuitem17 = new system.windows.forms.menuitem();
this.menuitem18 = new system.windows.forms.menuitem();
this.menuitem19 = new system.windows.forms.menuitem();
this.comu = new system.windows.forms.contextmenu();
this.menuitem4 = new system.windows.forms.menuitem();
this.menuitem5 = new system.windows.forms.menuitem();
this.menuitem6 = new system.windows.forms.menuitem();
this.menuitem7 = new system.windows.forms.menuitem();
this.comu1 = new system.windows.forms.contextmenu();
this.menuitem8 = new system.windows.forms.menuitem();
this.menuitem9 = new system.windows.forms.menuitem();
this.splitter1 = new system.windows.forms.splitter();
this.toolbar1 = new system.windows.forms.toolbar();
this.tbadddian = new system.windows.forms.toolbarbutton();
this.tbaddxian = new system.windows.forms.toolbarbutton();
this.tbaddquxian = new system.windows.forms.toolbarbutton();
this.tbaddqumian = new system.windows.forms.toolbarbutton();
this.tbline = new system.windows.forms.toolbarbutton();
this.tbshezhi = new system.windows.forms.toolbarbutton();
this.menuitem33 = new system.windows.forms.menuitem();
this.menuitem34 = new system.windows.forms.menuitem();
this.menuitem35 = new system.windows.forms.menuitem();
((system.componentmodel.isupportinitialize)(this.axmap1)).begininit();
((system.componentmodel.isupportinitialize)(this.axmap2)).begininit();
this.suspendlayout();
//
// axmap1
//
this.axmap1.anchor = ((system.windows.forms.anchorstyles)((((system.windows.forms.anchorstyles.top | system.windows.forms.anchorstyles.bottom)
| system.windows.forms.anchorstyles.left)
| system.windows.forms.anchorstyles.right)));
this.axmap1.enabled = true;
this.axmap1.location = new system.drawing.point(8, 120);
this.axmap1.name = "axmap1";
this.axmap1.ocxstate = ((system.windows.forms.axhost.state)(resources.getobject("axmap1.ocxstate")));
this.axmap1.size = new system.drawing.size(424, 339);
this.axmap1.tabindex = 0;
this.axmap1.polytoolused += new axmapxlib.cmapxevents_polytoolusedeventhandler(this.mapmain_polytoolused);
this.axmap1.mouseupevent += new axmapxlib.cmapxevents_mouseupeventhandler(this.axmap1_mouseupevent);
this.axmap1.thememodifyrequested += new axmapxlib.cmapxevents_thememodifyrequestedeventhandler(this.axmap1_thememodifyrequested);
this.axmap1.mousedownevent += new axmapxlib.cmapxevents_mousedowneventhandler(this.axmap1_mousedownevent);
this.axmap1.mapviewchanged += new system.eventhandler(this.axmap1_mapviewchanged);
//
// axmap2
//
this.axmap2.anchor = ((system.windows.forms.anchorstyles)((((system.windows.forms.anchorstyles.top | system.windows.forms.anchorstyles.bottom)
| system.windows.forms.anchorstyles.left)
| system.windows.forms.anchorstyles.right)));
this.axmap2.enabled = true;
this.axmap2.location = new system.drawing.point(472, 136);
this.axmap2.name = "axmap2";
this.axmap2.ocxstate = ((system.windows.forms.axhost.state)(resources.getobject("axmap2.ocxstate")));
this.axmap2.size = new system.drawing.size(240, 203);
this.axmap2.tabindex = 1;
//
// toolbar2
//
this.toolbar2.buttons.addrange(new system.windows.forms.toolbarbutton[] {
this.tbxuanze,
this.tbfangda,
this.tbbianxiao,
this.tbmanyou,
this.tbbiaozhu,
this.tbtianjiafuhao,
this.tbjuli,
this.tbmianji,
this.tbshuaxin,
this.tbxiangxi,
this.tbzuiduan});
this.toolbar2.buttonsize = new system.drawing.size(55, 35);
this.toolbar2.dropdownarrows = true;
this.toolbar2.location = new system.drawing.point(0, 0);
this.toolbar2.name = "toolbar2";
this.toolbar2.showtooltips = true;
this.toolbar2.size = new system.drawing.size(776, 41);
this.toolbar2.tabindex = 3;
this.toolbar2.buttonclick += new system.windows.forms.toolbarbuttonclickeventhandler(this.toolbar2_buttonclick);
//
// tbxuanze
//
this.tbxuanze.text = "選擇";
//
// tbfangda
//
this.tbfangda.text = "放大";
this.tbfangda.tooltiptext = "放大";
//
// tbbianxiao
//
this.tbbianxiao.text = "縮小";
//
// tbmanyou
//
this.tbmanyou.text = "漫游";
//
// tbbiaozhu
//
this.tbbiaozhu.text = "標注";
//
// tbtianjiafuhao
//
this.tbtianjiafuhao.text = "添加符號";
//
// tbjuli
//
this.tbjuli.text = "測距";
//
// tbmianji
//
this.tbmianji.text = "面積";
//
// tbshuaxin
//
this.tbshuaxin.text = "刷新";
//
// tbxiangxi
//
this.tbxiangxi.text = "詳細";
//
// tbzuiduan
//
this.tbzuiduan.text = "最短實體";
//
// label1
//
this.label1.location = new system.drawing.point(48, 104);
this.label1.name = "label1";
this.label1.size = new system.drawing.size(208, 16);
this.label1.tabindex = 4;
this.label1.text = "label1";
//
// mainmenu1
//
this.mainmenu1.menuitems.addrange(new system.windows.forms.menuitem[] {
this.menuitem1,
this.menuitem3,
this.menuitem10,
this.menuitem17,
this.menuitem18});
//
// menuitem1
//
this.menuitem1.index = 0;
this.menuitem1.menuitems.addrange(new system.windows.forms.menuitem[] {
this.menuitem20,
this.menuitem21,
this.menuitem22,
this.menuitem23,
this.menuitem24,
this.menuitem25,
this.menuitem26,
this.menuitem33,
this.menuitem35,
this.menuitem34,
this.menuitem2});
this.menuitem1.text = "文件";
//
// menuitem20
//
this.menuitem20.index = 0;
this.menuitem20.text = "打開地圖...";
this.menuitem20.click += new system.eventhandler(this.menuitem20_click);
//
// menuitem21
//
this.menuitem21.index = 1;
this.menuitem21.text = "添加圖層...";
this.menuitem21.click += new system.eventhandler(this.menuitem21_click);
//
// menuitem22
//
this.menuitem22.index = 2;
this.menuitem22.text = "-";
//
// menuitem23
//
this.menuitem23.index = 3;
this.menuitem23.text = "保存";
this.menuitem23.click += new system.eventhandler(this.menuitem23_click);
//
// menuitem24
//
this.menuitem24.index = 4;
this.menuitem24.text = "另存為...";
this.menuitem24.click += new system.eventhandler(this.menuitem24_click);
//
// menuitem25
//
this.menuitem25.index = 5;
this.menuitem25.text = "導出..";
this.menuitem25.click += new system.eventhandler(this.menuitem25_click);
//
// menuitem26
//
this.menuitem26.index = 6;
this.menuitem26.text = "-";
//
// menuitem2
//
this.menuitem2.index = 10;
this.menuitem2.text = "退出";
//
// menuitem3
//
this.menuitem3.index = 1;
this.menuitem3.menuitems.addrange(new system.windows.forms.menuitem[] {
this.menuitem29,
this.menuitem28,
this.menuitem27,
this.menuitem15,
this.menuitem32,
this.menuitem31,
this.mutuceng,
this.menuitem30,
this.menuitem16});
this.menuitem3.text = "地圖";
//
// menuitem29
//
this.menuitem29.index = 0;
this.menuitem29.text = "坐標變換(投影)";
this.menuitem29.click += new system.eventhandler(this.menuitem29_click);
//
// menuitem28
//
this.menuitem28.index = 1;
this.menuitem28.text = "-";
//
// menuitem27
//
this.menuitem27.index = 2;
this.menuitem27.text = "編輯";
this.menuitem27.click += new system.eventhandler(this.menuitem27_click);
//
// menuitem15
//
this.menuitem15.index = 3;
this.menuitem15.text = "-";
//
// menuitem32
//
this.menuitem32.index = 4;
this.menuitem32.text = "縮放圖層";
this.menuitem32.click += new system.eventhandler(this.menuitem32_click);
//
// menuitem31
//
this.menuitem31.index = 5;
this.menuitem31.text = "選擇圖層";
this.menuitem31.click += new system.eventhandler(this.menuitem31_click);
//
// mutuceng
//
this.mutuceng.index = 6;
this.mutuceng.text = "圖層控制";
this.mutuceng.click += new system.eventhandler(this.mutuceng_click);
//
// menuitem30
//
this.menuitem30.index = 7;
this.menuitem30.text = "-";
//
// menuitem16
//
this.menuitem16.index = 8;
this.menuitem16.text = "屬性";
this.menuitem16.click += new system.eventhandler(this.menuitem16_click);
//
// menuitem10
//
this.menuitem10.index = 2;
this.menuitem10.menuitems.addrange(new system.windows.forms.menuitem[] {
this.menuitem11,
this.menuitem12,
this.menuitem13,
this.menuitem14});
this.menuitem10.text = "注釋";
//
// menuitem11
//
this.menuitem11.index = 0;
this.menuitem11.text = "添加符號";
this.menuitem11.click += new system.eventhandler(this.menuitem11_click);
//
// menuitem12
//
this.menuitem12.index = 1;
this.menuitem12.text = "添加文本";
this.menuitem12.click += new system.eventhandler(this.menuitem12_click);
//
// menuitem13
//
this.menuitem13.index = 2;
this.menuitem13.text = "移除";
this.menuitem13.click += new system.eventhandler(this.menuitem13_click);
//
// menuitem14
//
this.menuitem14.index = 3;
this.menuitem14.text = "設置";
this.menuitem14.click += new system.eventhandler(this.menuitem14_click);
//
// menuitem17
//
this.menuitem17.index = 3;
this.menuitem17.text = "窗口";
//
// menuitem18
//
this.menuitem18.index = 4;
this.menuitem18.menuitems.addrange(new system.windows.forms.menuitem[] {
this.menuitem19});
this.menuitem18.text = "幫助";
//
// menuitem19
//
this.menuitem19.index = 0;
this.menuitem19.text = "關于mapx";
this.menuitem19.click += new system.eventhandler(this.menuitem19_click);
//
// comu
//
this.comu.menuitems.addrange(new system.windows.forms.menuitem[] {
this.menuitem4,
this.menuitem5,
this.menuitem6,
this.menuitem7});
//
// menuitem4
//
this.menuitem4.index = 0;
this.menuitem4.text = "普通";
this.menuitem4.click += new system.eventhandler(this.menuitem4_click);
//
// menuitem5
//
this.menuitem5.index = 1;
this.menuitem5.text = "矩形";
this.menuitem5.click += new system.eventhandler(this.menuitem5_click);
//
// menuitem6
//
this.menuitem6.index = 2;
this.menuitem6.text = "圓形";
this.menuitem6.click += new system.eventhandler(this.menuitem6_click);
//
// menuitem7
//
this.menuitem7.index = 3;
this.menuitem7.text = "多邊形";
this.menuitem7.click += new system.eventhandler(this.menuitem7_click);
//
// comu1
//
this.comu1.menuitems.addrange(new system.windows.forms.menuitem[] {
this.menuitem8,
this.menuitem9});
//
// menuitem8
//
this.menuitem8.index = 0;
this.menuitem8.text = "添加符號";
this.menuitem8.click += new system.eventhandler(this.menuitem8_click);
//
// menuitem9
//
this.menuitem9.index = 1;
this.menuitem9.text = "添加";
this.menuitem9.click += new system.eventhandler(this.menuitem9_click);
//
// splitter1
//
this.splitter1.location = new system.drawing.point(0, 41);
this.splitter1.name = "splitter1";
this.splitter1.size = new system.drawing.size(3, 432);
this.splitter1.tabindex = 5;
this.splitter1.tabstop = false;
//
// toolbar1
//
this.toolbar1.buttons.addrange(new system.windows.forms.toolbarbutton[] {
this.tbadddian,
this.tbaddxian,
this.tbaddquxian,
this.tbaddqumian,
this.tbline,
this.tbshezhi});
this.toolbar1.dock = system.windows.forms.dockstyle.none;
this.toolbar1.dropdownarrows = true;
this.toolbar1.location = new system.drawing.point(0, 40);
this.toolbar1.name = "toolbar1";
this.toolbar1.showtooltips = true;
this.toolbar1.size = new system.drawing.size(488, 28);
this.toolbar1.tabindex = 6;
this.toolbar1.textalign = system.windows.forms.toolbartextalign.right;
this.toolbar1.visible = false;
this.toolbar1.wrappable = false;
this.toolbar1.buttonclick += new system.windows.forms.toolbarbuttonclickeventhandler(this.toolbar1_buttonclick);
//
// tbadddian
//
this.tbadddian.text = "點 ";
this.tbadddian.visible = false;
//
// tbaddxian
//
this.tbaddxian.text = "線 ";
this.tbaddxian.visible = false;
//
// tbaddquxian
//
this.tbaddquxian.text = "曲線 ";
this.tbaddquxian.visible = false;
//
// tbaddqumian
//
this.tbaddqumian.text = "面 ";
this.tbaddqumian.visible = false;
//
// tbline
//
this.tbline.style = system.windows.forms.toolbarbuttonstyle.separator;
//
// tbshezhi
//
this.tbshezhi.text = "設置 ";
this.tbshezhi.visible = false;
//
// menuitem33
//
this.menuitem33.index = 7;
this.menuitem33.text = "打印設置";
//
// menuitem34
//
this.menuitem34.index = 9;
this.menuitem34.text = "-";
//
// menuitem35
//
this.menuitem35.index = 8;
this.menuitem35.text = "打印...";
//
// frmmain
//
this.autoscalebasesize = new system.drawing.size(6, 14);
this.clientsize = new system.drawing.size(776, 473);
this.controls.add(this.toolbar1);
this.controls.add(this.splitter1);
this.controls.add(this.label1);
this.controls.add(this.toolbar2);
this.controls.add(this.axmap2);
this.controls.add(this.axmap1);
this.menu = this.mainmenu1;
this.name = "frmmain";
this.text = "frmmain";
this.load += new system.eventhandler(this.form1_load);
((system.componentmodel.isupportinitialize)(this.axmap1)).endinit();
((system.componentmodel.isupportinitialize)(this.axmap2)).endinit();
this.resumelayout(false);

}
#endregion

#region 應用程序的主入口點
/// <summary>
/// 應用程序的主入口點。
/// </summary>
[stathread]
static void main()
{
frmmain fmain;
application.run(fmain=new frmmain());
}
#endregion

//****************************************
#region axmap1對象的屬性操作,一般都在其他窗口里被使用
/// <summary>
/// 在這里適用屬性主要是為了axmap1這個私有的對象能在其他窗體中獲得一些需要的改變
/// </summary>
///
//屬性1
public mapxlib.style systyle //屬性操作,設置或取得符號的樣式,在 frmannotation 中使用了該屬性,
{
set
{
axmap1.defaultstyle=value;
}
get
{
return axmap1.defaultstyle;
}
}
//屬性2
public mapxlib.style editstyle //屬性操作,設置或取得在編輯圖層時,改變的點,線和曲面的樣式 在frmeditable
{
set //中使用了該屬性,
{
axmap1.autoredraw=true;
axmap1.layers.insertionlayer.style=value;
}
get
{
axmap1.layers.insertionlayer.overridestyle=true;
axmap1.autoredraw=false;
return axmap1.layers.insertionlayer.style;
}
}
//屬性3
public mapxlib.layers layer //屬性操作,通過該屬性,圖層選擇顯示窗口(frmviewlyr)可以操作axmap1的layers屬性,
{ //在frmviewlyr_load 時可以得到 layers
get
{
return axmap1.layers;
}

}
//屬性4
public string lyrname //屬性操作,通過該屬性,得到圖層選擇顯示窗口(frmviewlyr)中coblyr.text中的值
{ //來顯示那個圖層將被顯示
set
{
if(value=="all layers")
axmap1.ctlbounds=axmap1.layers.bounds; //注意,這里使用ctlbounds屬性(mapx的屬性),而不是bounds(.net本身的屬性)在.net
else
axmap1.ctlbounds=axmap1.layers[value].bounds; //環境下,有點改變,

}
}


#endregion

//***********************************
#region 工具條,里面包含選擇、拖動漫游、放大縮小等一些工具

private void toolbar2_buttonclick(object sender, system.windows.forms.toolbarbuttonclickeventargs e)
{
try
{

if(e.button==tbfangda)
axmap1.currenttool=mapxlib.toolconstants.mizoomintool;//1003
if(e.button==tbbianxiao)
axmap1.currenttool=mapxlib.toolconstants.mizoomouttool;//縮小地圖
if(e.button==tbmanyou)
axmap1.currenttool=mapxlib.toolconstants.mipantool;//漫游地圖
if(e.button==tbbiaozhu) //標注地圖
{
axmap1.currenttool=mapxlib.toolconstants.milabeltool;

//point p=new point(20+55*5,20);
//comu1.show(toolbar2,p);

}
if(e.button==tbtianjiafuhao)
axmap1.currenttool=mapxlib.toolconstants.misymboltool;
if(e.button==tbjuli)
axmap1.currenttool=( mapxlib.toolconstants ) 10;
if(e.button==tbmianji)
axmap1.currenttool=(mapxlib.toolconstants ) 11;
if(e.button==tbshuaxin)
{
//刷新地圖,回到初始狀態
axmap1.zoomto(this.zoom,this.centerx,this.centery); //恢復初始時的比例
//axmap1.annotations.removeall();
axmap1.refresh();
}
if(e.button==tbxuanze)
{
point p=new point(20,20);
comu.show(toolbar2,p); //顯示選擇工具菜單,它允許選擇矩形,圓形,多邊形等
}


}
catch(exception e1)
{
messagebox.show(e1.message);
}
}

#endregion




發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阿拉善右旗| 北宁市| 凤阳县| 海城市| 灌云县| 阳春市| 辉南县| 襄樊市| 安岳县| 措美县| 洛扎县| 沙坪坝区| 循化| 赣州市| 建昌县| 祁阳县| 永济市| 晋宁县| 乐昌市| 内丘县| 沂南县| 桃园市| 芜湖县| 龙南县| 张家界市| 札达县| 读书| 渭源县| 巴青县| 独山县| 崇左市| 岳池县| 嘉善县| 屯门区| 焦作市| 垫江县| 蕲春县| 博罗县| 垫江县| 满洲里市| 德令哈市|