WINDow代碼﹕
来源:互联网 发布:编c语言用什么软件 编辑:程序博客网 时间:2024/06/11 22:37
只能輸入數字和小數﹕(keypKeyPress事件中調用)
if((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 46 && e.KeyChar != 8 && e.KeyChar != 13)
例子1﹕
private void textBox2_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 46 && e.KeyChar != 8 && e.KeyChar != 13)
this.textBox2.Enabled=false;
}
例子2﹕
private void textBox2_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar)) e.Handled = true;
this.textBox2.Enabled=false;
}
獲取本機IP地址﹕this.textBox1.Text = Dns.Resolve( Dns.GetHostName() ).AddressList[0].ToString();
鼠標懸停時顯示提示文字
private void button1_Click(object sender, System.EventArgs e)
{
ToolTip ttTemp = new ToolTip();
ttTemp.AutoPopDelay = 5000;
ttTemp.AutomaticDelay = 500;
ttTemp.InitialDelay = 100;
ttTemp.SetToolTip(this.button1, this.button1.Text||'123456');
}
- WINDow代碼﹕
- SMTP错误代碼
- 代碼民工
- 打印代碼
- 代碼碎片
- flex代碼
- 有選擇性倒計時提醒代碼
- MSNPSharp 代碼2
- MSNPSharp 代碼3
- MSNPSharp 代碼4
- MSNPSharp 代碼6
- MSNPSharp 代碼7
- MSNPSharp 代碼8
- MSNPSharp 代碼9
- MSNPSharp 代碼10
- MSNPSharp 代碼11
- Lotus常用代碼
- Excel VBA 代碼
- DbDateEdit_Component
- javascript简繁转换函数
- 对UTF8编码和ASCII编码文件读写的小测试
- 我对vs.net宏的应用
- 双缓冲实现滚动文本
- WINDow代碼﹕
- flash与服务端的交互方法
- 教你几招如何看透一个人
- 第二章笔记——《c++ programming language》Bjarne Strousrup著,裘宗燕译本
- 什么是爱情?
- 一个好的网站
- 体验Windows Forms
- 通过Mysql 的语句生成后门木马的方法
- 测试执行中非常有效的策略