2013-07-22 24 views
0

我有一個程序,我正在努力,讓用戶用文件瀏覽器選擇一個文件。一旦文件被選中,我希望我的表單上的預覽面板顯示所選文件的預覽圖像。該文件將始終是Microsoft Word文檔。有沒有人有一個例子或知道一個網站,解釋如何做到這一點?非常感謝!將預覽窗格添加到我的表單中?

編輯:這裏是我的代碼,到目前爲止:

private void button1_Click(object sender, EventArgs e) 
    { 
     // Create an instance of the Open File Dialog Box 
     var openFileDialog1 = new OpenFileDialog(); 

     // Set filter options and filter index 
     openFileDialog1.Filter = "Word Documents (.docx)|*.docx|All files (*.*)|*.*"; 
     openFileDialog1.FilterIndex = 1; 
     openFileDialog1.Multiselect = false; 

     // Call the ShowDialog method to show the dialog box. 
     openFileDialog1.ShowDialog(); 
     txtDocument.Text = openFileDialog1.FileName; 

    } 

我想預覽窗格添加到該表單,從而選擇該文件後,它會顯示該文件的圖形預覽。

enter image description here

回答

2

你應該閱讀View Data Your Way With Our Managed Preview Handler Framework獲得的如何顯示文件的預覽的想法。

更新鏈接,這篇文章在博客:

Blog - View Data Your Way With Our Managed Preview Handler Framework

+0

哇!這看起來像我需要的。一旦計時器結束,我會將其標記爲答案。非常感謝! – Kevin

+0

沒問題,祝你工作順利。 –

+0

鏈接讓我到一個有很多msdn雜誌的網站。你可以告訴我在哪本雜誌中找到這個答案的任何改變? – GuidoG