Practical -4
Practical -4
A radio button or option button enables the user to select a single option from a
group of choices when paired with other RadioButton controls. When a user clicks
on a radio button, it becomes checked, and all other radio buttons with same group
become unchecked
First step:
this.redlbl.Visible = false;
bluelbl.Visible = false;
greenlbl.Visible = false;
}
Second step:
if (redrbtn.Checked == true)
{
redlbl.Visible = true;
bluelbl.Visible = false;
greenlbl.Visible = false;
}
}
Third step:
private void bluerbtn_CheckedChanged(object sender, EventArgs
e)
{
if(bluerbtn.Checked == true )
{
bluelbl.Visible = true;
redlbl.Visible = false;
greenlbl.Visible = false;
}
}
Fourth step:
ListBox Control
The ListBox control is the simplest of the list-based controls and serves primarily to
display a
simple list of items in an easy-to-navigate user interface from which users can
select one or
more items.
First step:
The following code stepwise illustrate above design
Second step: write the following code under form load event
Step no-3:
}
Step no-4:
Step no-5:
listBox1.DataSource = strlist;
}
-------------------------------------------------------------------------------------------------------------------------------