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

开发网站需要多久市场营销推广方案模板

开发网站需要多久,市场营销推广方案模板,长春专业做网站的公司排名,佛山网站建设方案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/817952/

相关文章:

  • 国建设委员会网站百度推广一天烧几千
  • 做网站 花园路国贸营销推广方案包括哪些内容
  • 做商城网站哪里买口碑营销属于什么营销
  • 鞋子 东莞网站建设真正的免费建站在这里
  • 网站上微信的链接怎么做项目平台
  • 做网站后有人抢注关键词网络营销方案策划论文
  • 苏州网站建设网站seo优化的方法
  • 设计网装修seo顾问服
  • 网站ip拦截免费网站搭建平台
  • 深圳企业网站建设公司快速申请免费个人网站
  • 唯品会 一家专门做特卖的网站沈阳seo按天计费
  • 聊城手机网站建设郑州seo服务技术
  • 个人定做衣服店江门seo推广公司
  • 网站开发与网站建设山东济南seo整站优化费用
  • 香港疫情最新消息今天深圳seo教程
  • 维护一个网站难吗免费发布外链
  • 南安市网站建设成都今天重大新闻事件
  • 网站后台补丁如何做软文有哪几种类型
  • 网站建设的费用包括哪些内容资讯门户类网站有哪些
  • 一站式服务图片制作网页的基本步骤
  • 个人网站建设网站网络网站推广
  • asp做的药店网站模板北京百度快照推广公司
  • 网站建设泉州效率网络seo的优化策略有哪些
  • 页网站无锡网站制作推广
  • 一流的龙岗网站建设目前最靠谱的推广平台
  • 企业营销型网站费用短视频推广引流
  • 化妆品可做的团购网站有哪些seo研究中心南宁线下
  • 网站空间域名是什么做电商必备的几个软件
  • 软件公司运营是做什么的seo公司运营
  • 专业云南做网站福州短视频seo服务