private void button1_Click(object sender, EventArgs e) { fChannel.UseDefaultBrush(); fChannel.UseDefaultPen(); fChannel.Flush(); int width = fDeviceContext.SizeInPixels.Width; int height = fDeviceContext.SizeInPixels.Height; switch (fDemoCounter) { case 0: LineDemo1 aLineDemo = new LineDemo1(ClientRectangle.Size); aLineDemo.ReceiveCommand(new Command_Render(fChannel)); break; case 1: RectangleTest aRectTest = new RectangleTest(ClientRectangle.Size); aRectTest.ReceiveCommand(new Command_Render(fChannel)); break; case 2: aTextTest.Dimension = ClientRectangle.Size; aTextTest.ReceiveCommand(new Command_Render(fChannel)); break; case 3: SineWave siner = new SineWave(ClientRectangle.Size, 100); siner.ReceiveCommand(new Command_Render(fChannel)); break; case 4: PolygonTest polygoner = new PolygonTest(ClientRectangle.Size); polygoner.ReceiveCommand(new Command_Render(fChannel)); break; case 5: bezierer.Dimension = ClientRectangle.Size; bezierer.ReceiveCommand(new Command_Render(fChannel)); break; case 6: GraphTest grapher = new GraphTest(ClientRectangle.Size); grapher.ReceiveCommand(new Command_Render(fChannel)); break; case 7: RandomRect randrect = new RandomRect(ClientRectangle.Size); randrect.ReceiveCommand(new Command_Render(fChannel)); break; case 8: RegionTest regionTest = new RegionTest(ClientRectangle.Size); regionTest.ReceiveCommand(new Command_Render(fChannel)); break; case 9: PathTest pathTest = new PathTest(ClientRectangle.Size); pathTest.ReceiveCommand(new Command_Render(fChannel)); break; } ((Button)sender).Text = fDemoCounter.ToString(); fDemoCounter++; if (fDemoCounter == 10) { fDemoCounter = 0; } }