January 2003
Intermediate to advanced
896 pages
19h 58m
English
The following example is a "slide show" component into which a number of images can be loaded and then displayed in sequence. The control is called SlideShow. It contains two private variables: pics to hold an ArrayList object containing Image references, and pos to hold the current position in the slide show.
public class SlideShow : System.Windows.Forms.Control
{
private ArrayList pics;
private int pos;
⋮
}These variables are given suitable initial values in the control’s constructor.
public SlideShow()
{
pics = new ArrayList();
pos = 0;
⋮
}The public method AddImage allows the user of the control to add an image reference, which is added to the list held ...
Read now
Unlock full access