You need to cast the string to a float, or if that doesn't work the use Single.Parse.
Code:
private void Button1_Click(object sender, System.EventArgs e)
{
string s = "You have checked following Check Boxes:<BR>";
for(int j=0;j<chkBx.Items.Count;j++)
{
if(chkBx.Items[j].Selected)
{
s += chkBx.Items[j].Text + "<BR>";
lblChkBx.Text = s;
}
else
{
lblChkBx.Text = "you need to Check check Boxes!";
}
}
}
The difference is that the second method requires that the value of txtInput.Text is a correctly formatted decimal number and will throw an exception if it isn't.
Bookmarks