I have a cell in a Layout Panel in a C# project that contains text that represents a countdown. Every second the text updates to show the time remaining. The background color of the cell is dark green and the text is white. The problem is that everytime the text changes (every second) the background of that cell flashes white for an extremely brief, but annoying moment. Does anyone know how to eliminate the flashing? Thanks for considering my problem.
Countdown Timer Text Background Flashes every second
Collapse
X
-
Sorry, I don't know what you mean by Layout Panel or a cell in it. I looked in my Visual Studio and I had a FlowLayoutPanel and a TableLayoutPane l, but those just hold controls so you can't actually update text in them.
It would be helpful if you could paste a bit of code to describe the problem you're having. I'm not sure what else to suggest at this point, sorry! -
Every time the text changes, it forces a redraw of the panel. Try putting the text in it's own textbox instead. The reduction in background size might make the flash less noticeable, if it still occurs.
Another thing to try might be to set the parent control's background to the same color, if this is possible (eg doesn't ruin something else).Comment
-
-
Gary: Sorry, its a Table Layout Panel
Mark: Nope, not a WPF
JKM: Setting the parent to the same background color helped a lot. The flash is still there, but its the same color flash as the backround so not quite so noticable. Would still like to eliminate it if I could.Comment
-
What have you got inside the TableLayoutPane l that you're setting text on? So far as I can tell, you just put controls in so sorry, I'm a bit confused. I can't really help you until I understand it better.
Code or a sample project might help. Actually that's something I like to do in general when I'm working on a larger problem. Wherever possible, I'll boil it down to something that fits inside a simple example project and test/debug there before working on the larger product. If anything, it saves compile time if your main project is large ;) Sorry for the digression there, but yes please help us understand what we're dealing with.
Thanks!Comment
Comment