Chris
Chris

Reputation: 279

C# Image GetObject

I'm looking at open source from a 3rd party and found:

this.BackgroundImage = (Image)resourceManager.GetObject("$this.BackgroundImage");

What does the "$this" mean and where can I find the BackgroundImage?

Upvotes: 1

Views: 1120

Answers (1)

prprcupofcoffee
prprcupofcoffee

Reputation: 2970

Checking the documentation for ResourceManager.GetObject, $this doesn't have any special meaning. The whole string "$this.BackgroundImage" is just a tag that was applied to a resource on a form. This is typical of Windows Forms designers. Create a form, go to the properties window, choose the BackgroundImage property and select an image file on disk. Then open the form's .Designer.cs file and you'll see similar code.

Upvotes: 2

Related Questions