Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TextEdit.CustomTextLineHeight Event

Allows you to specify the height of a line of text in Advanced Mode.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Events")]
public event TextEditCustomTextLineHeightEventHandler CustomTextLineHeight

#Event Data

The CustomTextLineHeight event's data class is DevExpress.XtraEditors.TextEditCustomTextLineHeightEventArgs.

#Remarks

The following example increases the text line height by 2 pixels:

using DevExpress.XtraEditors;

namespace DXApplication {
    public partial class Form1 : XtraForm {
        int padding = 1;
        public Form1() {
            InitializeComponent();
            textEdit1.Properties.UseAdvancedMode = DevExpress.Utils.DefaultBoolean.True;
            textEdit1.CustomTextLineHeight += TextEdit1_CustomTextLineHeight;
        }

        private void TextEdit1_CustomTextLineHeight(object sender, TextEditCustomTextLineHeightEventArgs e) {
            e.Height = e.Height + 2 * ScaleDPI.ScaleVertical(padding);
        }
    }
}
See Also