c# - Transparent control flickering on scrolling -
i've created application in c# has custom buttons. these have transparent background therefore enherited control , override createparams/onpaintbackground , added invalidateex function.
now need grid layout(tablelayoutpanel) transparent. again created own control , override createparams/onpaintbackground , added invalidateex function. on scroll see backgrounds 'remembers' has drawn , therefore see ghosting (if thats correct word). hooking invalidateex function scroll event make panel flicker on scrolling.
is there way remove flicker?
public class gridlayout : tablelayoutpanel { public gridlayout() { this.scroll += delegate { this.invalidateex(); }; } protected override createparams createparams { { createparams cp = base.createparams; cp.exstyle |= 0x20; //transparent return cp; } } protected override void onpaintbackground(painteventargs e) { // nothing } protected void invalidateex() { if (parent == null) return; rectangle rc = new rectangle(this.location, this.size); parent.invalidate(rc, true); } }
i thought of using wpf haven't got experience in , need create in couple of days -> winforms.
Comments
Post a Comment