I am fairly new to C#, and have this problem....
on my form, i have some controls (imagelist, etc..)
from another class, i need to access imageList1
Here is a snippet of the class
Expand|Select|Wrap|Line Numbers
- public System.Windows.Forms.Button AddNewButton(int Top, int Left, int Width, int Height)
- {
- // Create a new instance of the Button class.
- System.Windows.Forms.Button aButton = new System.Windows.Forms.Button();
- // Add the button to the collection's internal list.
- this.List.Add(aButton);
- // Add the button to the controls collection of the form
- // referenced by the HostForm field.
- HostForm.Controls.Add(aButton);
- // Set intial properties for the button object.
- aButton.Top = Top;// Count * 25;
- aButton.Left = Left;// 100;
- aButton.Height = Height;
- aButton.Width = Width;
- aButton.Tag = this.Count;
- aButton.Text = ButtonProperties[this.Count].Text ;
- if (ButtonProperties[this.Count].Lock == true) aButton.BackColor = System.Drawing.Color.Red;
- if (ButtonProperties[this.Count].Lock == true) aButton.BackgroundImage = imageList1.Images[0];
- aButton.Click += new System.EventHandler(ClickHandler);
- return aButton;
- }
Any help would be appreciated.