Message 1 of 7

Not applicable
05-08-2015
05:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a dialog box (windows form) that has (2) two radio button groups which contain (3) three radio button options each. What I am trying to do is start the right routine based on the value of ValueSelected1 as shown in the code below. I just dont know how to invoke the command once the value is set. Any help would be appreciated.
private void OK_Button_Click(object sender, EventArgs e) { string value1 = ""; string value2 = ""; if (All_Pipe_RadioButton.Checked) { value1 = All_Pipe_RadioButton.Text; } else if (Multiple_Pipe_RadioButton.Checked) { value1 = Multiple_Pipe_RadioButton.Text; } else if (Single_Pipe_RadioButton.Checked) { value1 = Single_Pipe_RadioButton.Text; } if (Ten_Feet_RadioButton.Checked) { value2 = Ten_Feet_RadioButton.Text; } else if (TwentyOne_Feet_RadioButton.Checked) { value2 = TwentyOne_Feet_RadioButton.Text; } else if (User_Feet_RadioButton.Checked) { value2 = User_Feet_TextBox.Text; } string ValueSelected1 = value1; string ValueSelected2 = value2; string path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"/XYZ Tools/Log Files/Radio Button Selection.txt"; using (StreamWriter writer = new StreamWriter(path, false)) { writer.WriteLine(ValueSelected1 + "," + ValueSelected2); } }
Solved! Go to Solution.