private void Bt_enter_Click(object sender, RoutedEventArgs e) { if (LV.SelectedIndex != -1) { /* OleDbConnection conn = new OleDbConnection(odbcConnStr); conn.Open(); string sql = "select 测站,类型,编码,N,E,Z from Buildstation"; OleDbDataAdapter adp = new OleDbDataAdapter(sql, conn); DataSet ds = new DataSet(); adp.Fill(ds, "Buildstation"); int c = LV.SelectedIndex; */ DataRowView data = LV.SelectedItem as DataRowView; if (data != null && data is DataRowView) { //传参 Window_jianzhan7 window_jianzhan7 = new Window_jianzhan7(); window_jianzhan7.station.Text = data.Row["测站"].ToString(); window_jianzhan7.Show(); this.Close(); } else { MessageBox.Show("请选择数据!", "提示"); } } }
private void ESC_Click() { Window_jianzhan7 window_jianzhan7 = new Window_jianzhan7(); window_jianzhan7.Show(); this.Close();//关闭当前窗口 }
private void DuoDianDingXiang_Click(object sender, RoutedEventArgs e) { Window_jianzhan7 window_jianzhan7 = new Window_jianzhan7(); window_jianzhan7.Show(); this.Close();//关闭当前窗口 }