c# - TextBox addHandler for onFocus programmatically wp7 -


i trying add event handler textboxes in grid i'v written code below--->

// code foreach (var child in (o grid).children)  {    if (child.gettype() == typeof(textbox))    {     child.addhandler(ongotfocus, new routedeventhandler(textbox_gotfocus), true); //<---error                                }  } 

in above code want add event handler onfocus child textboxes.

but getting error here invalid arguments, can 1 fix this?

solved problem--->

txtbox.gotfocus += (sender, eargs) =>                                 {                                     if (txtbox.text == startingtext[index])                                         txtbox.text = "";                                 };  txtbox.lostfocus += (sender, eargs) =>                                 {                                     if (txtbox.text == "")                                         txtbox.text = startingtext[index];                                 }; 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -