Entry

An Entry control is used for single-line text input.


        <Entry x:Name="fruitEntry"
        Text="Mangosteen"
        TextChanged="OnTextChanged" />
                

Code Behind

A TextChanged event is raised whenever the text in the editor changes.


                    void OnTextChanged(object sender, EventArgs e)
                    {
                        var text = ((Entry)sender).Text;
                        Console.WriteLine(text);
                    }
                

A Completed event is raised when input has ended by pressing on the keyboard return key.


        <Entry x:Name="fruitEntry"
            Text="Mangosteen"
            Completed="OnTextCompleted" />
                

Limiting the length of Entry

The length of the Entry can be limited by specifying the MaxLength property.


        <Entry x:Name="fruitEntry"
            Text="Mangosteen"
            MaxLength="50" />
                

Keyboard Property

The keyboard presented for interaction with Entry can be set to the following type:

Default, Chat (with emoji), Email, Numeric, Plain, Telephone, Text, and Url


        <Entry x:Name="numberEntry"
                Text="12345678"
                Keyboard="Numeric" />
                

Read Only

Setting an Entry to read only.


        <Entry x:Name="fruitEntry"
            Text="Mangosteen"
            IsReadOnly="true" />
                

Display a clear button

Display a clear button while editing.


        <Entry x:Name="fruitEntry"
            Text="Mangosteen"
            ClearButtonVisibility="WhileEditing" />
                

TextTransform

Transform the text to Lowercase or Uppercase.


        <Entry x:Name="fruitEntry"
            Text="Mangosteen"
            TextTransform="Uppercase" />
                

Download

.NET MAUI