六安建六安建设网站,有哪些免费做外贸网站,网站打开是404,深圳网站seo哪家快其他基础控件1.Window2.Button3.CheckBox4.ComboBox5.DataGrid 6.DatePicker7.ExpanderGroupBox控件修改Style需要注意使用Grid分两行进行展示第0行显示Header第1行显示Content。Header#xff1a;添加Border并边框BorderThickness1 内部新增 ContentPresenter 然… 其他基础控件1.Window2.Button3.CheckBox4.ComboBox5.DataGrid 6.DatePicker7.ExpanderGroupBox控件修改Style需要注意使用Grid分两行进行展示第0行显示Header第1行显示Content。Header添加Border并边框BorderThickness1 内部新增 ContentPresenter 然后设置ContentSourceHeader。引用Style后效果如下Content添加Border并边框BorderThickness1 0 1 1 内部新增 ContentPresenter 。引用Style后效果如下有更好的方式欢迎推荐。01—代码如下1Styles.GroupBox.xaml 代码如下ResourceDictionary xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:sysclr-namespace:System;assemblymscorlibResourceDictionary.MergedDictionariesResourceDictionary Source../Themes/Basic/ControlBasic.xaml/ResourceDictionary Source../Themes/Basic/Animations.xaml//ResourceDictionary.MergedDictionariesStyle TargetType{x:Type GroupBox} BasedOn{StaticResource ControlBasicStyle}Setter PropertyTemplateSetter.ValueControlTemplate TargetType{x:Type GroupBox}GridGrid.RowDefinitionsRowDefinition HeightAuto /RowDefinition Height* //Grid.RowDefinitionsBorder Grid.Row0 BorderThickness1Border.BorderBrushSolidColorBrush Color{DynamicResource BaseColor}//Border.BorderBrushBorder.BackgroundSolidColorBrush Color{DynamicResource LighterColor}//Border.BackgroundContentPresenter Margin10ContentSourceHeader RecognizesAccessKeyTrue //BorderBorder Grid.Row1BorderThickness1,0,1,1 SnapsToDevicePixelsTrueBorder.BorderBrushSolidColorBrush Color{StaticResource BaseColor} //Border.BorderBrushBorder.BackgroundSolidColorBrush Color{DynamicResource WhiteColor}//Border.BackgroundContentPresenter Margin4 //Border/Grid/ControlTemplate/Setter.Value/Setter/Style/ResourceDictionary2使用Styles.GroupBox.xaml如下WrapPanel Margin0,10GroupBox HeaderGroupBox1Rectangle Fill{DynamicResource DangerSolidColorBrush}Width400 Height300//GroupBoxGroupBox HeaderGroupBox1 Margin10,0 IsEnabledFalseRectangle Fill{DynamicResource LightSolidColorBrush}Width400 Height300//GroupBox/WrapPanel02—效果预览[1][2]参考资料[1]GitHub: https://github.com/WPFDevelopersOrg[2]Gitee: https://gitee.com/WPFDevelopersOrg