|
-
Jun 27th, 2010, 03:49 AM
#1
Thread Starter
Junior Member
[Solved] Double Buffered?
Hello Guys,
I have a problem
I have a backgroundpicture in the form and 2 panels 'transparant'
problem is now as I have a great many of buttons on the screen
and when i scroll down my screen will flicker a lot 
I have set the form1 doublebuffered = true
and i have used a code.
And that works perfectly
Code:
Public Sub EnableDoubleBuffering()
' Set the value of the double-buffering style bits to true.
Me.SetStyle(ControlStyles.DoubleBuffer _
Or ControlStyles.UserPaint _
Or ControlStyles.AllPaintingInWmPaint, _
True)
Me.UpdateStyles()
End Sub
if you don't have many buttons offcourse
it start when you have a lot of buttons on the screen
but when you scroll down its go all wrong 
and i have used the panel_paint but when i do that and set
Code:
doublebuffered = true
and start it again its just flicker like crazy and the program stuck 
please somebody that can help?
Dummy1912
Last edited by Dummy1912; Jun 27th, 2010 at 09:22 AM.
-
Jun 27th, 2010, 08:42 AM
#2
Re: Double Buffered?
Hi Dummy1912,
You have set the form's DoubleBuffered property to True, done it again with your EnableDoubleBuffering sub, and then again by putting doublebuffered=true your panel_paint sub. Making the form double buffered only affects the form's background, not the controls, even if you do it 3 times .
You can make controls double buffered too, but it takes a little more work. Here's how you can make a double buffered a panel. Add a Class to your project, call it DoubleBufferedPanel (or whatever you like) and code it like this:
vb.net Code:
Public Class DoubleBufferedPanel
Inherits Panel
Public Sub New()
Me.DoubleBuffered = True
End Sub
End Class
Then you build the solution. The DoubleBufferedPanel will appear in the toolbox with a cogwheel icon. You can drag it onto a form and set its properties exactly like a normal panel.
Maybe you already put a lot of work into setting you present Panel's controls and properties. If so, you can replace it by a DoubleBufferedPanel without changing anything else like this:
1. In Solution Explorer, click the Show All Files button.
2. Find your form's Designer.vb file and open it.
3. Replace "System.Windows.Forms.Panel" wherever it occurs by "DoubleBufferedPanel".
4. Save it and rebuild your solution.
There is a good chance this will stop the flickering, but there could be other causes.
BB
-
Jun 27th, 2010, 09:05 AM
#3
Thread Starter
Junior Member
Re: Double Buffered?
hello boops boops,
thanks i gone try it out
hope its works.
thanks alot.
Dummy1912
-
Jun 27th, 2010, 09:21 AM
#4
Thread Starter
Junior Member
Re: Double Buffered?
Great thanks boops boops
i just a little bit but thats fine
im glad is REALLY better now 
thank you so much
Dummy1912
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|