2010-11-05 124 views

回答

6

不知道我理解你想要的這裏,但這裏有兩個例子

的前景和背景

<Button Content="Button" FontSize="50" Margin="0,0,263,155"> 
    <Button.Background> 
     <ImageBrush ImageSource="C:\Time.png"/> 
    </Button.Background> 
    <Button.Foreground> 
     <ImageBrush ImageSource="C:\C1.png"/> 
    </Button.Foreground> 
</Button> 

alt text

相同的圖像作爲前景和背景

<Button Content="Button" 
     FontSize="50" 
     Foreground="{Binding RelativeSource={RelativeSource self}, Path=Background}"> 
    <Button.Background> 
     <ImageBrush ImageSource="C:\Time.png"/> 
    </Button.Background> 
</Button> 

兩個不同的圖像

alt text

+0

+1我忘了'ImageBrush'!這可能是所有OP的需求。 – 2010-11-05 16:53:42