Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何制作圆角wpf表格_Wpf_Xaml - Fatal编程技术网

如何制作圆角wpf表格

如何制作圆角wpf表格,wpf,xaml,Wpf,Xaml,希望在WPF的主窗口中使用角半径。但是,当我使用边界控制来执行此操作时,它不起作用 我的问题是,我希望我的申请书有一个圆角。我使用usercontrol完成了这项工作,但无法使用WPF中的主窗体完成这项工作 所以请告诉我我是怎么做到的 这是我的xaml代码 <window....> <Grid> <Border CornerRadius="10"> <Grid> -------------

希望在WPF的主窗口中使用角半径。但是,当我使用边界控制来执行此操作时,它不起作用

我的问题是,我希望我的申请书有一个圆角。我使用usercontrol完成了这项工作,但无法使用WPF中的主窗体完成这项工作

所以请告诉我我是怎么做到的

这是我的xaml代码

<window....>
 <Grid>
     <Border CornerRadius="10">
       <Grid>
          -------------
       </Grid>
     </Border>
 </Grid>
</window>

-------------
您可以添加到边框: BorderBrush=“Red”BorderThickness=“1”

带圆角的边框将显示出来

<Border CornerRadius="10" BorderBrush="Red" BorderThickness="1">
    ...your code
</Border>

…您的代码

这应该适合您

<Window ...
        WindowStyle="None"
        Background="Transparent">
<Border CornerRadius="10"
        Background="White">
    <Grid>
    </Grid>
</Border>

转到App.xaml

<Application.Resources>
    <Style TargetType="Whatever Kind of Button You Wand" x:Key="RoundedButtons">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Whatever Button You have decided">
                    <Grid>
                        <Border Margin="5" Padding="5" BorderThickness="1" BorderBrush="#d9d9d9" Background="#595959" CornerRadius="10">
                        </Border>
                        <ContentPresenter HorizontalAlignment="Center"
                                      VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

然后,当您想将此样式应用于按钮时

<Button Style="{StaticResource RoundedButtons}"/>


我也这样做了,但在主窗体中没有效果。还是长方形。你说的“主形”是什么意思?你的屏幕所在的Windows框架?我知道了。只需使用以下命令-------------