title: VSTO AddIn for Excel - How to prevent Custom Task Pane loosing focus?
body: <p>I created a simple AddIn for MS Excel, but having a problem with the Custom Task Pane.</p>
  
  <p>Custom Task Pane control is written in WPF, but whenever user tries to input some data to the textbox field in CTP which he previously selected with the mouse, Excel steels the focus and return it to the selected cell.</p>
  
  <p>Can I prevent this behavior?</p>
  
  <p>The solution that user need to apply is to press "Esc" button on the keyboard, and than he can again select the input control in the CTP and write to it.</p>
  
  <p>The same happens with controls that are having context menus. When user clicks on the control with right mouse button, context menu is shortly visible and focus is returned to the Excel Worksheet.</p>
  
  <p>If user is actively editing some cell than he can't select the neither of controls in CTP before finishing edit but can access the ribbon buttons.</p>
  
  <p>Please, point me to the existing solutions if applicable.</p>