private void btnSelect_Click(object sender, EventArgs e) { frmSelectSignMaterialDialog frmSelectSignMaterialDialog = new frmSelectSignMaterialDialog(); frmSelectSignMaterialDialog.ShowDialog(); if (frmSelectSignMaterialDialog.DialogResult == DialogResult.OK) { tbDocnumber.Text = frmSelectSignMaterialDialog.queryResult; materialId = int.Parse(frmSelectSignMaterialDialog.queryId); frmSelectSignMaterialDialog.Close(); } }