几个关于控件的优先级:UseSystemPasswordChar>PasswordChar>控件属性设置

王朝学院·作者佚名  2016-08-28
窄屏简体版  字體: 小  |  中  |  大  |  超大  

1usingSystem;2usingSystem.Data;3usingSystem.Drawing;4usingSystem.Text;5usingSystem.Windows.Forms;6namespaceTest057{8publicpartialclassForm1 : Form9{10publicForm1()11{12InitializeComponent();13}14PRivatevoidForm1_Load(objectsender, EventArgs e)15{16textBox1.PassWordChar ='*';17textBox2.UseSystemPasswordChar =true;18}19}20}

[flash=500,400]http://s1.knowsky.com/20160211/t40kw3gdc0e00.png[/flash]

textBox1.PasswordChar = '*',在窗体设置中选择的是“#”,而且不报错,需要我们以代码为主,代码中设置的显示符会最终决定显示效果,而且,优先级

UseSystemPasswordChar > PasswordChar > 控件属性设置

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航