Label Control Refresh Problem

02-27-2003, 09:48 AM
I have a problem with the screen refresh (paint, redraw .. not sure of the most appropriate term) of 2 labels, one of which overlaps the other. Basically I am using what I will call label 1 as a rectangle with no caption (to get the click event which the shape lacks). Label 1 has an opague background. I change the color of the background color based on the state of an integer variable. But for now lets say that label 1 is always set to a Dark Grey Background. (By the way, all of the controls mentioned exist within a frame control) Now I have a second label, label 2, which has a caption of 1 character from the symbol font. The background of label 2 is set to transparent. At design time label 2 is on top of label 1, overlaping approximately 25% of label 1's area. At run time I change the .left position of label 2, either moving it closer to label 1, or further from label 1, to create an animation. I change write the .background color of label 1, and the .left position of label 2 every 500mS. My problem is this: Only when label 1 is dark grey, I will sometimes see a light grey background of label 2 where it overlaps label 1 during the 500mS screen refresh. This does not happen EVERY refresh, but consistently occurs during SOME refreshes. I have tried changing the Autoredraw and ClipControls property for the form in all combinations with no luck. And this ONLY seems to happen when label 1 is dark grey, not any other color. Can someone point me in the right direction??

Thanks in advance,


02-27-2003, 05:17 PM
I would suggest posting a small code example, it is some times difficult to understand long texts.
Your are more likely to get responses when people fully understand what you are asking.

03-02-2003, 11:01 AM
I would look for an easier way to put a colored, clickable background on the label, like using a picturebox. You could even forgo the label and use the DrawText API call to draw the symbol. But some code would be good if you want to keep the current method.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum