2011-03-10 90 views
0

我實際上有一個自定義任務窗格上我的Outlook加載項,工作得很好。我的問題是,我想改變我的customTaskPane上的一個按鈕的可見性,但我不知道如何在我的thisAddin中做到這一點。更改customTask上按鈕的可見性

我試圖做的那部分代碼。也許它更容易理解。

if (person.Role == 1) 
         { 
          //Person is SysAdmin no Button display 
          //How could I change state of my button ?? 
         } 
         else if (person.Role == 2) 
         { 
          //Person is ServiceAdmin display refused button 

         } 
         else if (person.Role == 3) 
         { 
          //Person is ServiceAgent display refused and considered button when mail is 
          //not considered and respond button where mail is considered 

         } 

回答

0

我解決了我的問題。

我把解決方案,如果任何人有同樣的問題。

我把代碼放在userControl.cs而不是thisAddin中,並將「person.Role」信息保存在currentInformation上,以便在userControl.cs上檢索它。