form flickering

K

Konrad

Hi

When I'am starting application
main window paint itself very slowly
with horrible flickering.
How to paint window without visibility
and then display it fast.
I tried with opacity and API WM_SETREDRAW
but sitll it isn't what should be.
Can somebody help?

Thanks
Konrad
 
B

Bernie Yaeger

Hi Konrad,

Did you try application.doevents()? Alos, what is the form doing that
requires it to take a long time to load?

HTH,

Bernie Yaeger
 
Y

Ying-Shen Yu[MSFT]

Hi Konrad,
Could you give us more information about your main form? especially
what you did in the constractor and the On_load event.
Also if you need add some items into a control, maybe you need the
BeginUpdate/EndUpdate method.
If you still have problem on it, Is it possible to repro it in a simple
project, I'll look at it to see if I can figure out it.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 
K

Konrad

As i Know Form doesn't have method BeginUpdate.
The Form has many ordinary controls.
I set opacity=0 in construktor of form
and opacity =1.0 in Load function and
during starting it works well.
But if I changing forms (thera are some added to main form but invisible) in
my program
I'am usin WM_SETREDRAW and then
form comming invisible for the moment.
If I'am not using opacity with previous 0
and next 1.0 on start is flickering but
during changing visibility of controls all work
vell. Forms exchanged smooth and quickly.

I don't understand why.

Thanks
Konrad
 
H

Herfried K. Wagner [MVP]

* "Avi Elenko said:
How about control(s).SuspendLayout() / control
(s).ResumeLayout()

This will be done automatically when using the designer to generate the
code with the form.
 
Y

Ying-Shen Yu[MSFT]

Hi Konrad,

Thanks for your reply!

From your description, you mean you first changed the opacity property to 0
then set it back to 1.0, then you met the problem. Using opacity will
disable the hardware acceleration on this window, and setting it back to
1.0 will not enable it , you may try setting AllowTransparency to false
after setting the opacity back to 1.0. It should solve this problem.

If you still have problem on it, please be free to reply to this thread.
Thanks!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top