簡體   English   中英

為DevExpress TextEdit設置DisplayFormat和EditFormat

[英]Set DisplayFormat and EditFormat for DevExpress TextEdit

我有一個具有以下屬性的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設置為數值,但是什么也沒發生。 請告訴我如何應用千位分隔符。

在此處輸入圖片說明

轉到dexexpress文本編輯的properties屬性,然后將masktype設置為numeric。 然后將遮罩設置為“,#######”。 這將顯示千位分隔符,不帶任何小數位。 我已經對其進行了測試,並且可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM