[英]C# - If A Radiobutton Selected In GroupBox, Unselect Other Radiobuttons In Other GroupBoxes
[英]Go to Other Forms with RadioButton in C#
在c#windowsForm應用程序中,我有3個窗體,在第一個窗體中,我有2個RadioButtons。 如果要選擇RadioButton1,我要轉到Form2,如果要選擇RadioButtn2,我要轉到Form3。
我怎樣才能做到這一點?!
只需使用單選按鈕的CheckedChanged
事件來檢測選擇了哪個單選並啟動表單
private void radioButton_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked)
new Form1().Show();
else
new Form2().Show();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.