当前位置: 首页 > news >正文

node网站开发需要学什么惠州网络推广平台

node网站开发需要学什么,惠州网络推广平台,广州做网站发多少钱,做网站不用tomcat行吗1&#xff0c;效果 2&#xff0c;代码&#xff1a; WPF的PasswordBox不能像Winform中的PasswordBox那样&#xff0c;通过PasswordBox.PasswordChar(char)0显示明文。所以这里使用无外观控件构筑掩码明文切换。 无外观控件遵守Themes/Generic.xaml文件配置. <ResourceDicti…

1,效果

 

2,代码:

        WPF的PasswordBox不能像Winform中的PasswordBox那样,通过PasswordBox.PasswordChar=(char)0显示明文。所以这里使用无外观控件构筑掩码明文切换。

无外观控件遵守Themes/Generic.xaml文件配置.

<ResourceDictionaryxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="clr-namespace:StudentInfoManagerWPF"><Style TargetType="{x:Type local:PasswordBoxExt}"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type local:PasswordBoxExt}"><Grid><PasswordBox  x:Name="Part_Pwd"  VerticalContentAlignment="Center" Padding="0,0,30,0"  PasswordChar="{TemplateBinding PasswordChar}"></PasswordBox><TextBox x:Name="Part_TxtBox" VerticalContentAlignment="Center" Padding="0,0,30,0" Visibility="Collapsed" Text="{Binding RelativeSource={RelativeSource  Mode=FindAncestor,   AncestorType=local:PasswordBoxExt, AncestorLevel=1}, Path=Password}"></TextBox><ToggleButton x:Name="Part_Toggle"  HorizontalAlignment="Right" MaxWidth="30" ><ToggleButton.Template><ControlTemplate TargetType="ToggleButton"><Grid><Image x:Name="Part_ImgShow" Source="/icon/1.png" Visibility="Collapsed"></Image><Image x:Name="Part_ImgHide" Source="/Icon/2.png" Visibility="Visible"></Image></Grid><ControlTemplate.Triggers ><Trigger Property="IsChecked" Value="true"><Setter Property="Visibility" Value="Visible" TargetName="Part_ImgShow"></Setter><Setter Property="Visibility" Value="Collapsed" TargetName="Part_ImgHide"></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate></ToggleButton.Template></ToggleButton></Grid><ControlTemplate.Triggers><Trigger SourceName="Part_Toggle" Property="IsChecked" Value="true"><Setter TargetName="Part_TxtBox" Property="Visibility" Value="Visible"></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style>
</ResourceDictionary>
public class PasswordBoxExt : Control{public static readonly DependencyProperty PasswordProperty;public static readonly DependencyProperty PasswordCharProperty;PasswordBox passwordBox;static PasswordBoxExt(){DefaultStyleKeyProperty.OverrideMetadata(typeof(PasswordBoxExt), new FrameworkPropertyMetadata(typeof(PasswordBoxExt)));PasswordProperty = DependencyProperty.Register("Password", typeof(string), typeof(PasswordBoxExt),new PropertyMetadata(new PropertyChangedCallback(PasswordPropertyChanged)));PasswordCharProperty = DependencyProperty.Register("PasswordChar", typeof(char), typeof(PasswordBoxExt), new PropertyMetadata('*'));}private static void PasswordPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e){//如此每次变化均导致passwordbox被重新覆盖新值,致使光标每次置于字符串首位而不是字符串末尾//if( (d as PasswordBoxExt).passwordBox != null)// {//     (d as PasswordBoxExt).passwordBox.Password = e.NewValue.ToString();// }}/// <summary>/// 密码/// </summary>public string Password{get{return (string)GetValue(PasswordProperty);}set{SetValue(PasswordProperty, value);}}/// <summary>/// 掩码字符/// </summary>public char PasswordChar{get{return (char)GetValue(PasswordCharProperty);}set{SetValue(PasswordCharProperty, value);}}public override void OnApplyTemplate(){base.OnApplyTemplate();passwordBox=  this.GetTemplateChild("Part_Pwd") as PasswordBox;ToggleButton btn = this.GetTemplateChild("Part_Toggle") as ToggleButton;if (passwordBox != null){passwordBox.PasswordChanged += Pwdbox_PasswordChanged;}if (btn != null){btn.Click += Btn_Click;}}private void Btn_Click(object sender, RoutedEventArgs e){if((sender as ToggleButton).IsChecked == false){passwordBox.Password = Password;}}private void Pwdbox_PasswordChanged(object sender, RoutedEventArgs e){if(sender is PasswordBox){Password = (sender as PasswordBox).Password;}}}

添加自定义控件

<DockPanel  Grid.Row="2" Grid.Column="1"  VerticalAlignment="Center"><TextBlock Text="密码:"  DockPanel.Dock="Left"   FontSize="16"></TextBlock><local:PasswordBoxExt x:Name="pwd01" PasswordChar="#" DockPanel.Dock="Right"  MinHeight="30" Margin="10,0,0,0"></local:PasswordBoxExt></DockPanel>

http://www.hkea.cn/news/341213/

相关文章:

  • 网站后台地址一般是在线seo优化工具
  • 海曙区住房和建设局网站备案域名
  • 网站建设硬件环境志鸿优化设计答案
  • 网页游戏网址推荐宁波网站推广网站优化
  • 福建就福建省住房与城乡建设厅网站高端网站建设企业
  • 网站如何做seo规划app怎么开发出来的
  • 吴江住房和城乡建设局官方网站产品软文是什么
  • 公司网站制作设谷歌seo是什么职业
  • 北京品牌高端网站建设公司燕郊今日头条
  • 网站制作公司徐州宁波网站seo哪家好
  • 做网站基本费用大概需要多少全媒体运营师报考官网在哪里
  • 网站建设款属于什么科目营业推广策划
  • 建设网站查证书网络广告有哪些形式
  • 分布式网站开发网络销售平台排名
  • 网站建设模板购买品牌seo培训
  • 深圳网站建设 cms网站推广交换链接
  • 标准物质网站建设5118站长工具箱
  • 做一个能注册用户的网站网络推广费用大概价格
  • 网站建设评价东莞谷歌推广
  • php网站后台进不去百度推广入口官网
  • 个人网站一键生成免费推广网站有哪些
  • 厦门做网站设计电商seo优化
  • wordpress视频点播seo技术是干什么的
  • 网站推广是怎么做的网络营销专业如何
  • 平面设计线上兼职上海网站seo
  • 个性化网站定制价格今日热点
  • 做网站的艰辛免费个人网站申请
  • 网站改版需要多久网站设计与制作毕业论文范文
  • 深圳横岗网站建设网站建设的推广渠道
  • 有没有什么网站免费做名片2023年新闻小学生摘抄