-1
다음 양식으로 이동하려면 DialogResult를 사용하고 라디오 단추가있는 다음 양식에서는 보이지 않거나 보이지 않는 컨트롤을 선택하고 싶습니다. 내가 라디오를 사용할DialogResult를 Windows에서 사용하십시오. 폼 응용 프로그램 C#
private void Form1_Load(object sender, EventArgs e)
{
First_form first = new First_form();
if (first.ShowDialog() == DialogResult.OK)
{
MessageBox.Show("Device Found!");
serialPort1 = first.comport;
first.comport.Close();
serialPort1.Close();
serialPort1.Open();
timer1.Enabled = true;
timer2.Enabled = true;
pictureBoxConect.Visible = true;
label_conect.Visible = true;
}
else
{
MessageBox.Show("Not Device Found!");
pictureBoxDisconect.Visible = true;
label_disconect.Visible = true;
}
}
:
this.DialogResult = DialogResult.OK;
loader.Enabled = false;
this.Close();
return;
질문이 명확하지 않습니다. – Hybridzz
두 가지 양식에서 일부 공용 속성을 선언하고 동일한 네임 스페이스에서 액세스 할 수 있습니다. 또는 생성자에 매개 변수를 전달하여이 작업을 수행 할 수 있습니다. –