为DevExpress TextEdit设置DisplayFormat和EditFormat

时间:2015-08-20 12:15:24

标签: c# winforms devexpress

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

我想设置一个显示和编辑格式(只有一千个分隔符),我已经测试过了#34; N0"和" f0"并将formatType设置为numeric但没有任何反应。请告诉我如何应用千位分隔符。

1 个答案:

答案 0 :(得分:1)

enter image description here

转到dexexpress text-edit的properties属性,并将masktype设置为numeric。然后将Mask设置为“,#######”。这将显示千位分隔符,不带任何小数。我测试了它并且它有效。

相关问题