Пример #1
0
 private void TBFocusEvent(object sender, EventArgs e)
 {
     FrameworkElement element = sender as FrameworkElement;
     var par = element.Parent as UIElement;
     selGrid = null;
     selDPB = null;
     selTB = (TextBox)sender;
     selTB.Focus();
     selTB.BorderThickness = new Thickness(1);
     var control = sender as UIElement;
     if (control != null && control.GetType() == typeof(TextBox) && par.GetType() != typeof(Grid))
     {
         selCanv.Children.Remove(control);
         selCanv.Children.Add(control);
     }else
         if (control != null && control.GetType() == typeof(TextBox) && par.GetType() == typeof(Grid))
         {
             selGrid = (Grid)par;
             selGrid.Focus();
         }
 }
Пример #2
0
 private void GridFocusEvent(object sender, EventArgs e)
 {
     selTB = null;
     selDPB = null;
     selGrid = (Grid)sender;
     selGrid.Focus();
 }