Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I have an app, can be resized, no code in the resize event as I am relying on dock and anchors to fill up form.

Its a form, with a tabcontrol inside, and a datagrid inside each of the tabs (7 in total). If I maximise it, so its full screen, then minimize it and leave it for about 5 or 10 minutes and then click on the app tray to pop it back up to maximized, the datagrid scroll on the right hand side just flickers like a madman - and the top of the screen is sort of, hard to explain, half-drawn. its a big black bar going across it.

If I click on some of the rows which are populated, the scroll bar stops flickering.

I am using the doublebuffer code for the datagrids to make them scroll smoother - i might try that to see if that is the issue (perhaps that is why microsoft left that property out of the datagridview?)

Any help would be greatly appreciated :) Cheers chaps and chappesses

What I have tried:

changing the autoscale to none to see if that would make any difference, it has stopped the locking up - but im getting awful flicker and black bar across the top of my form
Posted
Updated 17-Jul-16 7:18am

That is because in such cases the Paint Events get fired numerous times and every time your Form repaints, all its children are forced to repaint too. The flickering is the result of this expensive update. What you can do is, Hide() any controls until the Form completely shows up as a whole. Then you can Show() again its children, but im not certain if this technique will remove all flickering, due to the fact of the heavy combination you are using with TabControl and multiple DataGridViews.
 
Share this answer
 
try putting everything inside of a panel then the scroll will in it and to active it you just need to code in the sub were the form loads:
VB
Panel1.AutoScroll = True
       Panel1.VerticalScroll.Visible = False Or Panel1.HorizontalScroll.Visible = False
 
Share this answer
 

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