PictureBox.ImageLocation 屬性

定義

取得或設定要在 PictureBox 中顯示之影像的路徑或 URL。

public:
 property System::String ^ ImageLocation { System::String ^ get(); void set(System::String ^ value); };
public string ImageLocation { get; set; }
member this.ImageLocation : string with get, set
Public Property ImageLocation As String

屬性值

String

要在 PictureBox 中顯示之影像的路徑或 URL。

備註

屬性值可以是實際路徑 (,例如「C:\SomeFolder\SomeSubFolder\Picture.jpg」) 、相對路徑 (「\SomeSubFolder\Picture.jpg」) 或 URL (http://contoso.com/images/Picture.jpg) 。

如果使用相對路徑,則會被視為相對於工作目錄。

呼叫 Load 方法會覆寫 ImageLocation 屬性,並將 設定 ImageLocation 為方法呼叫中指定的 URL 值。

適用於