[DevExpress] sets the watermark text for TextEdit, devexpresstextedit

Source: Internet
Author: User

[DevExpress] sets the watermark text for TextEdit, devexpresstextedit

Key code:

        public static void SetWatermark(this TextEdit textEdit, string watermark)        {            textEdit.Properties.NullValuePromptShowForEmptyValue = true;            textEdit.Properties.NullValuePrompt = watermark;        }        public static void ClearWatermark(this TextEdit textEdit)        {            if (textEdit.Properties.NullValuePromptShowForEmptyValue)                textEdit.Properties.NullValuePrompt = string.Empty;        }

Test code:

Private void formateload (object sender, EventArgs e) {textEdit1.SetWatermark ("Enter the user name .... "); textEdit2.SetWatermark (" enter your password .... ");} private void simplebutton#click (object sender, EventArgs e) {textEdit1.ClearWatermark (); textEdit2.ClearWatermark ();}
Code effect:
  

In DevExpress, how does one obtain the attributes of TextEdit?

For example, your TextEdit Name = textID value: string id = this. textID. Text;
 
Set the amount format for TextEdit in the devExpress control package

DisplayFormat = "{0: c2 }"
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.