views:

734

answers:

5

Hey guys, I know that in primitive versions of vb (as found in excel) there was a line that you could insert to prevent screens from flickering to and fro when it is trying to process something.

Application.screenupdating = false

I am currently using vb.net in Visual Studio 2008 but i was wondering if anyone knows the equivilent for this version. It doesnt recognise this call in VS 2008 using vb.net. Any help would be appreciated! Thanks in advance guys!

+2  A: 

Depends on control. Quite a lot of controls (e.g. ListView) have BeginUpdate and endUpdate methods that server that exact purpose.

list.BeginUpdate()
list.Items.Add(...)
list.Items.Add(...)
list.Items.Add(...)
...
list.EndUpdate()
Josip Medved
A: 

Globals.ThisWorkbook.Application.ScreenUpdating = False

Joel Goodwin
+1  A: 

The SuspendLayout and ResumeLayout methods should do the trick. SuspendLayout prevents a control/form from redrawing itself until you call the ResumeLayout method.

Stewbob
A: 

re: when it is trying to process something

you can disable the form

Beth
A: 

I have the same problem with a panel, in this panel I put an user control, i have 10 panels and when my application runs and when i try to change any panel they flicker to show the control. What can I do to avoid this problem, Any help would be appreciated!!!!!!!1 Thanks

Moy