how to use terminal operator

Posted by Oswaldlily under C# on 12/13/2012 | Points: 10 | Views : 1515 | Status : [Member] | Replies : 2
I don want if loop...how to use in this method?????

foreach (Control ctrl in formname.Controls)
{
string _a = ctrl is Label ? _listLabel.Add(ctrl.Name); : ctrl.Name.ToString();

}


error: showing here
_listLabel.Add(ctrl.Name)




Responses

Posted by: Saratvaddilli on: 12/13/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
what was your requirement exactly , your question was some what ambiguity for me...

Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kundnani.Rt on: 1/19/2013 [Member] Starter | Points: 25

Up
0
Down
Try this:

foreach (Control ctrl in formname.Controls) 

{
string _a = ctrl is Label ? _listLabel.Add(ctrl.Name) : ctrl.Name.ToString();
}


Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response