C# Panel Graphics disappear
Posted on 2003-03-12
I am new to the Panel in the VS.Net Environment. I am using a Panel to draw a Map as follows (the map is made up of Lightblue points):
Graphics g = panel1.CreateGraphics();
//Looping through an ArrayList of WayPoints (an object I created)
foreach(WayPoint wp in arrListWayPoints)
Then I added a scrollbar to view the points outside of the boundaries of the panel. I had to add a label to the panel (outside the viewable area) so that it will scroll to that point as follows:
Label l = new Label();
l.Text = "";
l.Location = new System.Drawing.Point(784, 448); //784,448 is a point outside of the viewable area
panel1.AutoScroll = true;
Now the Problem is that when I move the scrollbars to view an area of the panel, the graphics disappear. I tried using the panel1.Refresh property but it did not help.
any help is welcomed,
Mr. R. Sammut.