Answer:
/****************** The code for a form application that uses radioButtons * *and displays new form based on the user selection *****************/
Using system;
Using system windows forms;
namespace CarDealer
{
Public partial class Form1 : Form
{
public Form1()
{
//default constructor to initialize components
InitializeComponent();
}
//when user clicks on the details button
private void detail_Click
(Object sender, EventArgs e)
{
if (model1,Checked)
{
Forms2 f = new Form2()
f.ShowDialog()
model1.Checked = false
}
if (model2.Checked)
{
Form3 f = new Form3();
f.ShowDialog();
model2.Checked = false;
}
if (model3.Checked)
{
Form4 f = new Form4();
f.ShowDialog();
model3.Checked = false;
}
}
}
}
Explanation:
Program plan
- Design form: Place label controls with text as select car model and one empty label control to display total price. Change front type and size from each other labels properties window.
- Add three radio buttons with text Renault Kwit, Tata Tiago, Mahindra KUV 100.
- Add button with text View Details.
- Add 3 new windows form from project menu for each car model.
- Change form name and respective car models.
- Place picturebox control to each form by using image property add .jpeg image and place label control containing price of each model to each form
- When user select car model and click on view details, new form containing car model details is displayed.
Form Design is attached below