WS_EX_COMPOSITED in .NET

  • Thread starter Thread starter Mitchell Vincent
  • Start date Start date
M

Mitchell Vincent

When using C, I can do something like :

CreateWindowEx(WS_EX_COMPOSITED,
cWindowClass, cTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

To make sure there is no "flickering" when the window is painted. Can I
do this with VB.NET, is so, how?

Thanks!
 
Mitchell Vincent said:
To make sure there is no "flickering" when the window is painted. Can I
do this with VB.NET, is so, how?

Extend your form's/control's constructor like this:

\\\
Public Sub New()
Me.SetStyle( _
ControlStyles.ResizeRedraw Or _
ControlStyles.DoubleBuffer Or _
ControlStyles.AllPaintingInWmPaint, _
True _
)
Me.UpdateStyles()
End Sub
///
 
Herfried said:
Extend your form's/control's constructor like this:

\\\
Public Sub New()
Me.SetStyle( _
ControlStyles.ResizeRedraw Or _
ControlStyles.DoubleBuffer Or _
ControlStyles.AllPaintingInWmPaint, _
True _
)
Me.UpdateStyles()
End Sub
///

Thanks!
 
Herfried said:
Extend your form's/control's constructor like this:


Another question. Since this apparently isn't done by default, what are
the downsides?
 
Mitchell Vincent said:
Another question. Since this apparently isn't done by default, what are
the downsides?

I assume that it's memory usage. Using double buffering will cause the
control to be drawn to an internal bitmap and this bitmap to be drawn onto
the control's surface.
 

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

Back
Top