tags:

views:

200

answers:

0

I'm building an Excel 2003 VSTO workbook level customization and have placed windows forms buttons and comboboxes on the worksheets. I also have a freeze pane set on the sheet that divides the sheet into 4 sections. 1 2 3 4 The controls I place on a pane that can be scrolled, such as 2, would become deactivated (turn into the image placeholder similar to how it looks in design mode) due to the undefined behavior of using controls with split panes mentioned on MSDN. One way to reproduce is: 1. Put focus on the control. 2. Scroll to the right so the control is offscreen while still leaving focus on the control. 3. Click on a cell to remove focus from the control and onto the cell. 4. Scroll the control back into view and it should enter the unusable state.

The workarounds to fix this when it happens have been to have the user tab to another worksheet or remove the freeze pane. Programmatically putting focus on the control and then back on the worksheet seems to work, so I was wondering if there was a reliable way to detect when the control has entered this bad state?