我是Window Mobile App Development的新手,现在我已经创建了按钮,我已经成功创建了它,但问题是它没有填充按钮的边缘我设置的图像。
我已设置边框宽度并将所有内容填充为0但仍存在问题,我甚至已在Windows模拟器上签入
这就是它的样子。按钮应该填满图像?如何实现?
以下是代码:
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Image HorizontalAlignment="Left" Height="218" Margin="96,27,0,0" VerticalAlignment="Top" Width="270" RenderTransformOrigin="0.504,0.514" Source="/Assets/Images/qima_logo.png"/>
<TextBox HorizontalAlignment="Left" Height="72" Margin="46,301,0,0" TextWrapping="Wrap" Text="Username" VerticalAlignment="Top" Width="366" BorderBrush="DarkGray" BorderThickness="3" TextChanged="TextBox_TextChanged" InputScope="EmailUserName" AcceptsReturn="True" />
<TextBox HorizontalAlignment="Left" Height="72" Margin="46,373,0,0" TextWrapping="Wrap" Text="Password" VerticalAlignment="Top" Width="366" BorderBrush="DarkGray" InputScope="Password"/>
<Button Content="Login" HorizontalAlignment="Left" Margin="46,450,0,0" VerticalAlignment="Top" Width="366" Height="88">
<Button.Background>
<ImageBrush ImageSource="/Assets/Images/btn_bg.png"/>
</Button.Background>
</Button>
<Button Content="Organization List" Margin="0,649,0,0" Width="455" BorderThickness="0" Padding="0" UseLayoutRounding="True" HorizontalAlignment="Right" Click="Button_Click">
<Button.Background>
<ImageBrush Stretch="UniformToFill" ImageSource="/Assets/Images/organizations_list_btn.png" AlignmentX="Left"/>
</Button.Background>
</Button>
<Button Content="Membership List" HorizontalAlignment="Left" Margin="0,580,0,0" VerticalAlignment="Top" Width="456" Foreground="White">
<Button.BorderBrush>
<ImageBrush Stretch="UniformToFill" ImageSource="/Assets/Images/members_list_btn.png"/>
</Button.BorderBrush>
<Button.Background>
<ImageBrush ImageSource="/Assets/Images/members_list_btn.png" Stretch="UniformToFill"/>
</Button.Background>
</Button>
<Image HorizontalAlignment="Left" Height="42" Margin="46,533,0,0" VerticalAlignment="Top" Width="400" Source="/Assets/Images/members_list_btn.png" Stretch="Fill">
<Image.OpacityMask>
<ImageBrush ImageSource="/Assets/Images/members_list_btn.png"/>
</Image.OpacityMask>
</Image>
</Grid>