I have written a Mandelbrot program which writes colour data to a bitmap using the setpixel method. It wasn't a particularly fast method before under VBE beta 2 but now I have installed the new version VB2005 it takes ages! - over a minute to fill a screen sized bitmap! What is going on

Why is setpixel so slow?
VShaneCurtis
I have since discovered that the .exe file produced by VB2005 runs at an acceptable speed. It is only when running the program in debugging mode that setpixel is so slow. Other graphics routines are slowed down by a certain anmount when debugging but nothing like as much as setpixel. Can anyone explain Is anyone else out there using setpixel under VB2005
Here is the code I am using.
Imports
System.Drawing.Drawing2DPublic
Class Form1 'This example fills a 400x400 pixel bitmap with colour 'When run in debugging mode 'the SetPixel method takes over 6 seconds 'the FillRectangle mathod takes 2.5 seconds 'Why is the former slower than the latter and why are they both so slow 'When the exe file is run directly, both routines take less than half a second and setpixel is faster Dim start, finish As Double Dim n, x, y As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clickn = 400
Dim bm1 As New Bitmap(n, n) Dim bm2 As New Bitmap(n, n)start = Microsoft.VisualBasic.DateAndTime.Timer
For y = 0 To n - 1 For x = 0 To n - 1bm1.SetPixel(x, y, Color.Blue)
Next Nextfinish = Microsoft.VisualBasic.DateAndTime.Timer
TextBox1.Text = Str((finish - start) * 1000)
PictureBox1.BackgroundImage = bm1
Dim gr As Graphicsgr = Graphics.FromImage(bm2)
start = Microsoft.VisualBasic.DateAndTime.Timer
For y = 0 To n - 1 For x = 0 To n - 1gr.FillRectangle(Brushes.Red, x, y, 1, 1)
Next Nextfinish = Microsoft.VisualBasic.DateAndTime.Timer
TextBox2.Text = Str((finish - start) * 1000)
PictureBox2.BackgroundImage = bm2
End SubEnd
Class