默认以dns开头,textbox控件

解决方案 »

  1.   

    就是写一个判断,输入的时候必须以dns:开头,或者开头的值给出,后面的用户自己填写
      

  2.   

    你可以 写个自定义控件 以xxx开头
      

  3.   

    类似这样?
    textBox1.Text = textBox1.Text.IndexOf("dns:") == -1 ? "dns:" + textBox1.Text : textBox1.Text ;
      

  4.   

       if (c_bus.VideoEquipment != null)
                        {
                            c_bus.VideoEquipment = "dns:" + txtspsb.Text;
                        }
                        else
                        {
                            c_bus.VideoEquipment = txtspsb.Text;                    }