Microsoft Ribbon for WPF October 2010

  • 3167
  • 0

Microsoft Ribbon for WPF October 2010

Microsoft Ribbon for WPF 這個元件可以開發跟OFFICE 2010一樣的選單目錄元件,首先要下載Microsoft Ribbon for WPF.msi安裝後在C:\Program Files\Microsoft Ribbon for WPF\MicrosoftRibbonForWPFSourceAndSamples.zip有範例可以使用或是在微軟下載網頁也有範例Microsoft Ribbon for WPF Source and Samples.msi可以使用。

1執行Microsoft Ribbon for WPF.msi接著就Next一路按到底

image

2安裝結束後開啟vs2010 新增專案挑選你的撰寫語c# or vb 在來選擇專案範本 WPF Ribbon Application

image

3開啟專案範本如下接著加入下列程式代碼到加入此頁面

image

XAML:

<ribbon:RibbonTab x:Name="TEST"
                            Header="TEST">
              <ribbon:RibbonGroup x:Name="Group"
                                  Header="Group">
                  <ribbon:RibbonButton x:Name="Button" LargeImageSource="Images\LargeIcon.png" Label="測試" Click="Button_Click" />
              </ribbon:RibbonGroup>
          </ribbon:RibbonTab>

C#:

private void Button_Click(object sender, RoutedEventArgs e)
       {
           MessageBox.Show("OK");
       }

 

4執行結果

image