PictureBox.ImageLocation Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the path or URL for the image to display in the PictureBox.
public:
property System::String ^ ImageLocation { System::String ^ get(); void set(System::String ^ value); };
public string ImageLocation { get; set; }
public string? ImageLocation { get; set; }
member this.ImageLocation : string with get, set
Public Property ImageLocation As String
The path or URL for the image to display in the PictureBox.
The property value can be an actual path (for example, "C:\SomeFolder\SomeSubFolder\Picture.jpg"), a relative path ("\SomeSubFolder\Picture.jpg"), or a URL (http://contoso.com/images/Picture.jpg
).
If a relative path is used, it will be considered relative to the working directory.
A call to the Load method will overwrite the ImageLocation property, setting ImageLocation to the URL value specified in the method call.
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: