开发者

StatusStrip causes backgroundflickering

I have a main form which has a StatusStrip at the bottom. In this strip I show a label containing info about the last ope开发者_Go百科ration. This is done like this:

in Form constructor:

console.added += new EventHandler<Eventargs>(showlast);

console.added is a custom event, that is executed every time something gets added to the console list. Next the eventfunction:

private void showlast(object sender, EventArgs e)
{
  statusStripLabel1.Text = console.clist.Last().ToString().Replace('\t','');
}

while clist is the listelement of the static class console that contains my console entries.

Now what happens is this: if I show an other form on top of mainform which contains code, that adds entries to the console every time the console gets updated the main form in background flickers once - like it loaded again. Since The main form is fullscreen and most of the other forms are rather tool windows this can't be overseen :)

Do you know any way to maybe not load the whole form new when the strip gets updated? (if that is the reason?). Other wise I'll just have to remove the strip - but of course I'd like to keep it :)

Thanks for your answers in advance!!


There are a few things you could try:

1) Set DoubleBuffered = 'True' on Form.

2) Before setting statusStripLabel1.Text, check if existing text is not the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜