This page is archived
Quiz #7
1. Describe one way to create a rectangle located at 100,50 with height 200 and width 47.
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.FillRectangle(Brushes.Aqua, 100, 50, 47, 200);
base.OnPaint(e);
}
2. Describe the syntax for declaring a delegate named TryThis that is used to represent methods with the following signature:
<return-type>=bool and no method parameters.
public delegate bool TryThis();
delegate bool TryThis(); //also accepted