/// <summary> /// 经纬度转图幅号 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonLBToTFH_Click(object sender, EventArgs e) { MapScaleObject obj = this.comboBoxMapScale.SelectedItem as MapScaleObject; if (obj != null) { double L = 0; double.TryParse(this.textBoxToTFHL.Text.Trim(), out L); double B = 0; double.TryParse(this.textBoxToTFHB.Text.Trim(), out B); string tfh = TFHHelper.GetTFH(L, B, obj); this.textBoxTFH.Text = tfh; } }
private void buttonLTBRTFH_Click(object sender, EventArgs e) { MapScaleObject obj = this.comboBoxLTRBMapScale.SelectedItem as MapScaleObject; if (obj != null) { double ltl, ltb, rbl, rbb; double.TryParse(this.textBoxLTL.Text.Trim(), out ltl); double.TryParse(this.textBoxLTB.Text.Trim(), out ltb); double.TryParse(this.textBoxRBL.Text.Trim(), out rbl); double.TryParse(this.textBoxRBB.Text.Trim(), out rbb); string ltTFH = TFHHelper.GetTFH(ltl, ltb, obj); string rbTFH = TFHHelper.GetTFH(rbl, rbb, obj); this.textBoxLTTFH.Text = ltTFH; this.textBoxRBTFH.Text = rbTFH; } }