Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
So I have a unique situation. I have a lot of old WinForms projects written in VS2005 that I have been upgrading to VS2015. I have been doing this on a Win 7 WS but I also have a Win 10 WS that i'm migrating to. So my apps have a lot of datagridviews with scrollbars. Some are bound and others are unbound. When I view my upgraded app from within VS2015 or from the standalone app on my Win 7 box, everything looks fine. However, when I either run the published code from the standalone app or from within VS2015 on my Win 10 box, the scrollbars are gone. The scroll bars were there before on my Win 10 box prior to upgrading to VS2015. They are not completely gone like when you shutoff the scrollbars because you can still see the space where they are suppose to be, however, there is just nothing inside that space. There is no arrow on the top and bottom and no slider in between. This is happening to both the vertical and horizontal scrollbars.

What I have tried:

Found some articles online about this but none exactly match my issue. Some mention to disable the scrollbars and then reenable. I tried that and it didn't work. Other say to do a datgridview.performlayout and that didn't work as well. My code was written using DotNet 2.0 and I tried upgrading to 4.0 and that didn't work. I have written new apps in 2015 with datagridviews and those work fine. I just seem to be having issues on the ones I upgraded from VS2005.
Posted
Updated 30-Apr-21 6:48am

1 solution

Here are some things I have tried in similar situations - not all have worked all the time unfortunately, but I've usually managed to "get there"

- Examine the CSProj file to see if anything "leaps out". Possibly compare sections to one built from raw. E.g. Remove one of the datagridviews and rebuild it from scratch on Win10. Examine all the relevant project files to work out what the differences are between the two

- Instead of jumping from version x to version z, try migrating from version x to version y and then from y to z - in your case from VS2005 to say VS2008 and then to VS2015. You should be able to download free Community versions to do this. DGV was updated in VS2008 so this might just do the trick.

- Or, Rebuild on the Win10 machine and maintain both versions - make sure you completely clean the project before the rebuild. From what you are saying though, I doubt this will help
 
Share this answer
 
Comments
theskiguy 3-May-21 13:11pm    
I appreciate your post but I tried all your solutions but I didn't have any luck. I was, however, able to resolve the issue. As a test, I turned on "Enable XP visual styles" and then the scrollbars reappeared again. I have no clue why this worked but I thought I would post this so others will know.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900