【问题标题】:Set DisplayFormat and EditFormat for DevExpress TextEdit为 DevExpress TextEdit 设置 DisplayFormat 和 EditFormat
【发布时间】:2015-08-20 21:23:20
【问题描述】:

我有一个具有以下属性的 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);

我想为它设置一个显示和编辑格式(只有千位分隔符)我已经测试了“N0”和“f0”并将 formatType 设置为数字但没有任何反应。请告诉我如何应用千位分隔符。

【问题讨论】:

    标签: c# winforms devexpress


    【解决方案1】:

    进入 dexexpress 文本编辑器的 properties 属性,并将 masktype 设置为 numeric。然后将掩码设置为“,#######”。这将显示没有任何小数的千位分隔符。我已经测试过了,它可以工作。

    【讨论】:

    • 感谢您也可以在 EditMask 中使用 n0。它可以工作,但只是在编辑模式下,当文本框失去焦点时,不显示分隔符。我想为两者展示它。
    猜你喜欢
    • 2013-10-17
    • 2016-04-07
    • 1970-01-01
    • 2011-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多