c#怎么在后台载入地图,载入数据啊求教
求教啊,要求打开winform之后,地图在后台自动就载入了,不用再像下边的代码一样,打开默认路径,选择文件在载入了。如何修改呀~~~ private void buttonX2_Click(object sender, EventArgs e)
{
slider2.Value = 0; //进度条清零,初始化
OpenFileDialog openMXD = new OpenFileDialog();
openMXD.Title = "打开";
openMXD.InitialDirectory = Constant.DEFAULT_PATH;//设置默认打开路径
openMXD.Filter = "Map Documents (*.mxd)|*.mxd";//设定文件类型
if (openMXD.ShowDialog() == DialogResult.OK)
{
String mxdpath = openMXD.FileName;
axMapControl1.LoadMxFile(mxdpath);
IMpMap = axMapControl1.Map;
for (int i = 0; i <= 100; i++) //载入 假的样式的进度条
{
this.progressBarX1.PerformStep();
}
this.initEnabled(); //未载入地图之前,所有的按钮都不能使用,这是载入地图之后对初值的修改
}