开发者

Delphi: a modal form flickers

开发者 https://www.devze.com 2023-03-30 11:04 出处:网络
There is a modal form with: labels, buttons, group boxes. I call from a Form 1 on a button click: Form2.ShowModal;

There is a modal form with: labels, buttons, group boxes.

I call from a Form 1 on a button click: Form2.ShowModal;

When the form 2 appears first - all is ok be开发者_如何学Ccause of a blend effect. But next form's appearance has a flicker, especially labels, buttons. I tried to use DoubleBuffered:=True/False and ParentFont:=True/False (in case of a group box, frame). It doesn't help :(

Can anybody help please? Thanks!


OK this will do the trick, replace this solution if there are any better...

1st, OnFormCreate

Form2.AlphaBlendValue := 0;
Form2.AlphaBlend := true;

2nd, Add Timer, OnTimerEvent

Form2.AlphaBlendValue := 255;  
Form2.AlphaBlend := false;
Timer1.Enable := False;

3rd OnFormShow

Timer1.Enable := True;
0

精彩评论

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