I have a problem with screen flickering. I read some other topics on this case, but there are solutions that didn't work for me, I think that's because I don't know what exactly causes the problem.
My screen is has a large number of controls, maybe this is what causes the problem. I'll try to describe it as best, as I can.
First of all, I am using
WinForms
.I am making a video game, so the screen should be maximized all the time.
To allow stretching all the controls I am using
TablePanels
, one large that is docked to fill the whole form and a few smaller that also dock fill the large Table cells. In smaller cells of those tables, Buttons are docked fill.To show the background drawn buttons, I made control buttons completely transparent. It needs to stay that way.
The screen flickers white at positions of
TableLayoutPanels
borders.The screen flickers when a mouse enters the position of a Button, any Button, no matter where it is located.
For now, only one element changes actively during gameplay - a Label. When mouse enters the field of button, this label shows what this button does. For example if I enter the area of "Use" button, the label displays the word "USE".
I haven't tried that yet, but I must implement, that some images of button will change or become transparent, or lose transparency during game-play. Like there could be one image for closed cupboard, but when player opens it, another image of open cupboard appears. I think I know how to do it, all I want is to prevent flickering.
If you suggest using some code (and I expect it will be needed), please specify where I should put it.