01png.png (855.08 KB, 下载次数: 124)
【安装包制作工具】Install_Pack 6.0测试版
02.png (563.58 KB, 下载次数: 122)
【安装包制作工具】Install_Pack 6.0测试版
众城小伙 发表于 2021-6-23 09:17
麻烦问一下 源码运行报错 有什么环境要求吗 我是VS2015
JaBin 发表于 2021-4-22 09:44
看看,学习一下
LDM 发表于 2022-8-16 19:33
请问下 选择框怎么弄出来呢
public Style Set_CheckBoxStyle(string sKey, string text, string backcolor, string select_color, double height, double fontsize, string fontcolor,int num)
{
string style = @""
<ResourceDictionary xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<Style x:Key='"" + sKey + @""' TargetType='{x:Type CheckBox}'>
<Setter Property='SnapsToDevicePixels' Value='true' />
<Setter Property='FocusVisualStyle' Value='{DynamicResource CheckBoxFocusVisual}' />
<Setter Property='Height' Value='"" + height + @""'/>
<Setter Property='IsChecked' Value='False'/>
<Setter Property='Margin' Value='0'/>
<Setter Property='Template'>
<Setter.Value>
<ControlTemplate TargetType='CheckBox'>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width='Auto'/>
<ColumnDefinition Width='*'/>
</Grid.ColumnDefinitions>
<Grid Height='{TemplateBinding Height}' Width='{TemplateBinding Height}'>
<Rectangle x:Name='CheckBoxRectangle' Fill='""+ backcolor + @""' Opacity='0.3'/>
<Rectangle x:Name='CheckBoxRectangleOut' Stroke='"" + backcolor+@""' StrokeThickness='1' />
<Grid x:Name='CheckedMark' Width='"" + height + @""' Height='"" + height + @""' Visibility='Collapsed'>
<TextBlock Text='✓' FontSize='"" + (height - 3) + @""' Foreground='"" + select_color + @""' VerticalAlignment='Center' HorizontalAlignment='Center' />
</Grid>
</Grid>
<TextBlock Grid.Column='1' Text='"" + text + @""' FontSize='"" + fontsize + @""' Foreground='"" + fontcolor + @""' VerticalAlignment='Center' Margin='14,0,0,0'/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property='IsChecked' Value='True'>
<Setter TargetName='CheckedMark' Property='Visibility' Value='Visible'></Setter>
<Setter TargetName='CheckBoxRectangle' Property='Fill' Value='""+backcolor+@""'></Setter>
<Setter TargetName='CheckBoxRectangle' Property='Opacity' Value='1'></Setter>
<Setter TargetName='CheckBoxRectangleOut' Property='Stroke' Value='Transparent'></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>"";
StringReader strreader = new StringReader(style);
XmlTextReader xmlreader = new XmlTextReader(strreader);
object obj = XamlReader.Load(xmlreader);
ResourceDictionary controlStyle = (ResourceDictionary)obj;
Resources.MergedDictionaries.Add(controlStyle);
var custom = Resources.MergedDictionaries[Get_ResourceCount()];
return custom[sKey] as Style;
}
欢迎光临 CSkin博客 (http://bbs.cskin.net/) | Powered by Discuz! X3.2 |