using System; using System.Windows.Forms; using DevComponents.DotNetBar; using GeoScene.Data; using GeoScene.Globe; namespace Cyberpipe { public partial class FrmCustomLabel : Office2007Form { GSOLayer mLayer; GSOFeature mFeature; GSOGlobeControl globeControl1; public string labelText; public FrmCustomLabel(GSOGlobeControl globe, GSOLayer layer, GSOFeature feature) { InitializeComponent(); mLayer = layer; mFeature = feature; globeControl1 = globe; if (mFeature.GetFieldDefn("编号") != null) { textBoxX2.Text = mFeature.GetValue("编号").ToString(); } else { textBoxX2.Text = mFeature.Name; } if (mFeature.Label != null) { textBoxX1.Text = mFeature.Label.Text; } } /// <summary> /// 确定按钮事件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonX1_Click(object sender, EventArgs e) { if (textBoxX1.Text.Trim() != "") { labelText = textBoxX1.Text.Trim(); DialogResult = DialogResult.OK; } else { MessageBox.Show("请输入标注内容!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information); } } } }