Windows Vista 上的預設開啟和儲存對話方塊,在對話方塊左側有名為 [我的最愛連結] 的區域。 這塊區域稱為自訂位置。OpenFileDialog 和 SaveFileDialog 類別能夠讓您將資料夾加入至 CustomPlaces 集合。
注意事項 |
|---|
如果要讓自訂位置出現在 OpenFileDialog 或 SaveFileDialog 中,AutoUpgradeEnabled 屬性必須設定為 true (預設值)。 |
將自訂位置加入至檔案對話方塊
將路徑、已知資料夾 GUID 或 FileDialogCustomPlace 物件加入至對話方塊的 CustomPlaces 集合。
下列程式碼範例示範如何加入路徑:
OpenFileDialog1.CustomPlaces.Add("C:\MyCustomPlace")openFileDialog1.CustomPlaces.Add("C:\\MyCustomPlace");
請參閱
參考
FileDialogCustomPlacesCollection.Add
注意事項