Back to Devexpress

TextEdit.CustomTextLineHeight Event

windowsforms-devexpress-dot-xtraeditors-dot-textedit-3527b8bc.md

latest2.6 KB
Original Source

TextEdit.CustomTextLineHeight Event

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

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event TextEditCustomTextLineHeightEventHandler CustomTextLineHeight
vb
<DXCategory("Events")>
Public Event CustomTextLineHeight As TextEditCustomTextLineHeightEventHandler

Event Data

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

Remarks

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

csharp
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);
        }
    }
}
vb
Imports DevExpress.XtraEditors

Namespace DXApplication
    Partial Public Class Form1
        Inherits XtraForm

        Private padding As Integer = 1
        Public Sub New()
            InitializeComponent()
            textEdit1.Properties.UseAdvancedMode = DevExpress.Utils.DefaultBoolean.True
            AddHandler textEdit1.CustomTextLineHeight, AddressOf TextEdit1_CustomTextLineHeight
        End Sub

        Private Sub TextEdit1_CustomTextLineHeight(ByVal sender As Object, ByVal e As TextEditCustomTextLineHeightEventArgs)
            e.Height = e.Height + 2 * ScaleDPI.ScaleVertical(padding)
        End Sub
    End Class
End Namespace

See Also

TextEdit Class

TextEdit Members

DevExpress.XtraEditors Namespace