// Members added to form class automatically private Controls.Development.ImageListBoxItem graniteItem; private Controls.Development.ImageListBoxItem marbleItem; private Controls.Development.ImageListBoxItem stoneItem; private Controls.Development.ImageListBoxItem stuccoItem; ... private void InitializeComponent() { ... // Constructors first called for the class members this.graniteItem = new Controls.Development.ImageListBoxItem();
this.marbleItem = new Controls.Development.ImageListBoxItem();
this.stoneItem = new Controls.Development.ImageListBoxItem();
this.stuccoItem = new Controls.Development.ImageListBoxItem(); ... // Items added to the ImageListBox this.listBox1.Items.AddRange( new Controls.Development.ImageListBoxItem[] { this.graniteItem, this.marbleItem, this.stoneItem, this.stuccoItem}); ... // Member properties set ... // // graniteItem // this.graniteItem.ImageIndex = 0; this.graniteItem.Text = "Granite"; ... }
private Controls.Development.ImageListBoxItem graniteItem;
private Controls.Development.ImageListBoxItem marbleItem;
private Controls.Development.ImageListBoxItem stoneItem;
private Controls.Development.ImageListBoxItem stuccoItem;
...
private void InitializeComponent()
{
...
// Constructors first called for the class
members this.graniteItem = new
Controls.Development.ImageListBoxItem();
this.marbleItem = new
Controls.Development.ImageListBoxItem();
this.stoneItem = new
Controls.Development.ImageListBoxItem();
this.stuccoItem = new
Controls.Development.ImageListBoxItem();
...
// Items added to the ImageListBox
this.listBox1.Items.AddRange(
new Controls.Development.ImageListBoxItem[] {
this.graniteItem,
this.marbleItem,
this.stoneItem,
this.stuccoItem});
...
// Member properties set
...
//
// graniteItem
//
this.graniteItem.ImageIndex = 0;
this.graniteItem.Text = "Granite";
...
}