简体   繁体   English

为DevExpress TextEdit设置DisplayFormat和EditFormat

[英]Set DisplayFormat and EditFormat for DevExpress TextEdit

I have a DevExpress TextEdit with following properties: 我有一个具有以下属性的DevExpress TextEdit:

    this.txtPrice.EditValue = "";
    this.txtPrice.Location = new System.Drawing.Point(677, 73);
    this.txtPrice.Name = "txtPrice";
    this.txtPrice.Properties.Appearance.Font = new System.Drawing.Font("B Mitra", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178)));
    this.txtPrice.Properties.Appearance.Options.UseFont = true;
    this.txtPrice.Properties.DisplayFormat.FormatString = "f0";
    this.txtPrice.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
    this.txtPrice.Properties.Mask.BeepOnError = true;
    this.txtPrice.Properties.Mask.EditMask = "999999999999";
    this.txtPrice.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Simple;
    this.txtPrice.Size = new System.Drawing.Size(124, 24);
    this.txtPrice.TabIndex = 4;
    this.txtPrice.TextChanged += new System.EventHandler(this.txtPayed_TextChanged);

I want to set a display and edit Format (just a thousand separator) for it i have tested "N0" and "f0" and set formatType to numeric but nothing happened. 我想为其设置显示和编辑格式(仅隔一千个分隔符),我已经测试了“ N0”和“ f0”,并将formatType设置为数值,但是什么也没发生。 please tell me how to apply thousand separator to it. 请告诉我如何应用千位分隔符。

在此处输入图片说明

Go to the properties property of the dexexpress text-edit, and set masktype to numeric. 转到dexexpress文本编辑的properties属性,然后将masktype设置为numeric。 Then set the Mask to ",#######". 然后将遮罩设置为“,#######”。 This displays the thousands separator without any decimals. 这将显示千位分隔符,不带任何小数位。 I have tested it and it works. 我已经对其进行了测试,并且可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM