i am trying to add a event handler to the textboxes in a grid
so that i'v written the code below--->
// some code
foreach (var child in (o as Grid).Children)
{
if (child.GetType() == typeof(TextBox))
{
child.AddHandler(OnGotFocus, new RoutedEventHandler(TextBox_GotFocus), true); //<---error
}
}
in above code i want to add an event handler for onFocus for all child TextBoxes.
but its getting some error here about invalid arguments, can any one fix this?