成人黄色网站 Winform中使用MaskedTextBox制作IP地址输入框

发布日期:2025-07-03 23:20    点击次数:76

成人黄色网站 Winform中使用MaskedTextBox制作IP地址输入框

环境:C/S Winform C#成人黄色网站

Demo:

图片

功能:自动设置ip掩码,输入形如999.999.999.999的方式,并设置keydown事件,当输入.的时代,自动跳至下一栏。

措施:

1,从器用箱中拖入一个MaskedTextBox,定名为txtPACSIP;

2,在mask属性中,输入:999.999.999.999

波多野结衣 肛交

3,在prompt属性中,将_换为空格。若是你心爱_的话,也不错毋庸换。

4,创建KeyDown事件,附以下代码:

private void txtPACSIP_KeyDown(object sender, KeyEventArgs e)
 {
  if (e.KeyCode == Keys.Decimal)
  {
   int pos = txtPACSIP.SelectionStart;
   int max = (txtPACSIP.MaskedTextProvider.Length - txtPACSIP.MaskedTextProvider.EditPositionCount);
   int nextField = 0;
 
   for (int i = 0; i < txtPACSIP.MaskedTextProvider.Length; i++)
   {
 if (!txtPACSIP.MaskedTextProvider.IsEditPosition(i) && (pos + max) >= i)
  nextField = i;
   }
   nextField += 1;
 
   // We're done, enable the TabStop property again   
 
 
   txtPACSIP.SelectionStart = nextField;
 
  }
 }

虽然, 你若是念念将tab键也完了自动跳至下一栏的话,多加个要求就行。

5,在取值的流程中,铭刻要replace空格:

PingReply reply = p1.Send(this.txtPACSIP.Text.Replace(" ",""));

本站仅提供存储处事,悉数实质均由用户发布,如发现存害或侵权实质,请点击举报。



Powered by 亚洲色图 @2013-2022 RSS地图 HTML地图

Copyright Powered by站群 © 2013-2024 版权所有