using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using
Question:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Lab2 { public partial class Lab2 : Form { public Lab2() { InitializeComponent(); } private void resetMenuStrip_Click(object sender, EventArgs e) { LengthButton.Checked = false; AreaButton.Checked = false; VolumeButton.Checked = false; inputValue.Clear(); outputValue.Clear(); inputValue.Focus(); } private void exitMenuStrip_Click(object sender, EventArgs e) { this.Close(); } private void LengthButton_CheckedChanged(object sender, EventArgs e) { inputValue.Focus(); inputComboBox.Items.Clear(); outputComboBox.Items.Clear(); inputComboBox.ResetText(); outputComboBox.ResetText(); inputComboBox.Items.Add("Centimeter"); inputComboBox.Items.Add("Meter"); inputComboBox.Items.Add("Kilometer"); outputComboBox.Items.Add("Centimeter"); outputComboBox.Items.Add("Meter"); outputComboBox.Items.Add("Kilometer"); } private void AreaButton_CheckedChanged(object sender, EventArgs e) { inputValue.Focus(); inputComboBox.Items.Clear(); outputComboBox.Items.Clear(); inputComboBox.ResetText(); outputComboBox.ResetText(); inputComboBox.Items.Add("Square Centimeter"); inputComboBox.Items.Add("Square Meter"); inputComboBox.Items.Add("Square Kilometer"); outputComboBox.Items.Add("Square Centimeter"); outputComboBox.Items.Add("Square Meter"); outputComboBox.Items.Add("Square Kilometer"); } private void VolumeButton_CheckedChanged(object sender, EventArgs e) { inputValue.Focus(); inputComboBox.Items.Clear(); outputComboBox.Items.Clear(); inputComboBox.ResetText(); outputComboBox.ResetText(); inputComboBox.Items.Add("Gallons"); inputComboBox.Items.Add("Quarts"); inputComboBox.Items.Add("Liter"); outputComboBox.Items.Add("Gallons"); outputComboBox.Items.Add("Quarts"); outputComboBox.Items.Add("Liter"); } private void inputComboBox_SelectedIndexChanged(object sender, EventArgs e) { } private void outputComboBox_SelectedIndexChanged(object sender, EventArgs e) { } } }
Need help with the inputComboBox and ouputComboBox, with the code.
Design "Unit Converter" Windows Forms Application which uses the following controls: three group boxes, three radio buttons, two text boxes, two combo boxes, and a menu strip as shown in figure below. Please note that this unit converter contains three units' categories: length, area, and volume. A unit category is selected by clicking/checking an appropriate radio button. When a radio button is checked the corresponding unit's options will be available in both combo boxes for the user to select. In addition, all existing inputs/selections/results in both text boxes and combo boxes should be deleted, and the focus should be set on the input text box. It is required to have at least three units for each unit category. After selecting the unit category, the user should enter a value into the input text box and select a unit in the combo box contained in the group box "Convert FROM". The user should then select the unit in the second combo box to which the previously entered value will be converted and the result of the unit's conversion will be shown in the second text box. Please note that the result of the conversion will be computed and displayed when a unit is selected in a combo box. The "Reset" menu strip item will clear both text boxes and set focus on the input text box, while the "Exit" menu strip item will terminate the program.
Auditing and Assurance services an integrated approach
ISBN: 978-0132575959
14th Edition
Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley