2008-12-03 68 views

回答

12

您必須爲GridView.ColumnHeaderContainerStyle屬性創建樣式。通過將一些觸發器設置爲樣式來添加懸停效果。 樣品XAML波紋管

<ListView VerticalAlignment="Bottom" Height="63" IsSynchronizedWithCurrentItem="True"> 
     <ListView.View> 
      <GridView ColumnHeaderContainerStyle="{StaticResource GridViewColumnHeaderStyle1}" > 
       <GridViewColumn/> 
      </GridView> 
     </ListView.View> 
    </ListView> 

而且款式可以爲波紋管被創建,波紋管代碼將在

<Style x:Key="GridViewColumnHeaderStyle1" TargetType="{x:Type GridViewColumnHeader}"> 
     <Style.Triggers> 
      <Trigger Property="IsMouseOver" Value="true"> 
       <Setter Property="Background" Value="Green"/> 
      </Trigger> 
     </Style.Triggers> 
    </Style> 
+0

花花公子創建懸停綠色,謝謝。搖滾! – xanadont 2008-12-03 23:37:07