Thanks Bert. However, it didn’t solve the problem. After a couple of hours of investigation I have found it to be a very specific issue to do with the GridDesktop being contained within a TabControl that can be easily reproduced:
1. Create a new Windows Application project
2. Add a TabControl to the form
3. Add a GridDesktop to the first tab page
4. Run the application - the scrollbars will not display correctly and the grid will not respond to mouse events.
I also discovered two work-arounds:
1. Create a new Windows Application project
2. Add a TabControl to the form
3. Add a GridDesktop to the form, not the first tab page. It is important that the grid be parented to the form
4. In the constructor of the form (or Form_Load), set the grid’s Parent to the tab page (or other container that is the correct parent for the grid, in my case a Panel)
5. Run the application. The grid works as designed.
-or-
1. Create a new Windows Application project
2. Add a GridDesktop to the form
3. Add a TabControl to the form
4. Move the GridDesktop to the tab page, or other container
5. Run the application. The grid works as designed.
The issue as far as I can see is to do with the GridDesktop being parented to a TabPage within the designer. The designer-generated code adds the grid to the tab page and then sets the properties on the grid. This causes the problem. I was able to prove this by moving the designer-generated code:
this.tabPage1.Controls.Add(this.gridDesktop1);
to the end of the designer-generated code for the grid. Of course this will get overwritten next time the designer regenerates the code, hence the work-arounds. Simply add the grid to the tab page after all designer-generated code has been run.
Hope this helps somebody else as well.
Paul