Reputation: 19047
I have this class:
public class CameraWindow : PictureBox
Can i somehow access the Image
property from inside of the class?
And can i access the Events? like onload
?
Upvotes: 0
Views: 25348
Reputation: 178
Are you dealing with Windows Forms or similar? In that case the event is probably Load, and you can tie it up with something like Load += new EventHandler(Form1_Load);
The prompts will help you generate an event handler.
Upvotes: 0
Reputation: 100248
public class CameraWindow : PictureBox
{
void Test()
{
this.Image; // or just Image
}
}
public class CameraWindow : PictureBox
{
public override object Image
{
{ get { return base.Image; } }// note base
}
}
Upvotes: 6
Reputation: 60190
Sure, just use them... all public and protected members are directly accessible.
Upvotes: 6