private void btnVehicle_Click(object sender, EventArgs e) { frmCar frm = new frmCar(); if (frm.ShowDialog() == DialogResult.OK) { carModelId = frm.SELECTED_CAR_NAME_ID; //txtCar.Text = frm.SELECTED_CAR_TEXT; } }
private void btnVehicle_Click(object sender, EventArgs e) { try { frmCar frm = new frmCar(); if (frm.ShowDialog() == DialogResult.OK) { carModelId = frm.SELECTED_CAR_NAME_ID; txtCar.Text = frm.SELECTED_CAR_TYPE_TEXT; if (frm.SELECTED_CAR_TYPE_TEXT == "เดินเท้า" || frm.SELECTED_CAR_TYPE_TEXT == "ไม่ระบุ") { txtLicense.Text = ""; txtLicense.Enabled = false; Lbl_LicensePlate.Visible = false; txtLicense.Visible = false; Lbl_Vahicle.Visible = false; txtProvince.Visible = false; btnProvince.Visible = false; btnLicense.Visible = false; tableLayoutPanel2.Visible = false; tableLayoutPanel8.Visible = false; provinceId = 0; } else { Lbl_LicensePlate.Visible = true; txtLicense.Visible = true; txtLicense.Enabled = true; Lbl_Vahicle.Visible = true; txtProvince.Visible = true; btnProvince.Visible = true; btnLicense.Visible = true; tableLayoutPanel2.Visible = true; tableLayoutPanel8.Visible = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }