共用方式為


操作說明:將自訂位置加入至檔案對話方塊

Windows Vista 上的預設開啟和儲存對話方塊,在 [最愛的連結] 對話方塊左側有一個區域。 這個區域稱為自訂位置。 OpenFileDialogSaveFileDialog 類別可讓您將資料夾新增至 CustomPlaces 集合。

注意

為了讓自訂位置出現在 OpenFileDialogSaveFileDialog 中,AutoUpgradeEnabled 屬性必須設定為 true (預設值)。

將自訂位置新增至檔案對話方塊

  • 將路徑、已知資料夾 GUID 或 FileDialogCustomPlace 物件新增至對話方塊的 CustomPlaces 集合。

    下列程式碼範例示範如何新增路徑:

    OpenFileDialog1.CustomPlaces.Add("C:\MyCustomPlace")  
    
    openFileDialog1.CustomPlaces.Add("C:\\MyCustomPlace");  
    

另請參閱