Articles in this section
Category / Section

How to Change Return Button Text for .NET MAUI Numeric Entry?

3 mins read

This article outlines how to change the return button text for the .NET MAUI Numeric Entry control on iOS. The return button text can be customized by utilizing localization support.

To modify the return button text of the keyboard, follow these steps to initialize localization for the Numeric Entry control:

Step 1: Add a New .resx File

  1. In the project, create a new folder named Resources if it doesn’t already exist.
  2. Right-click on the Resources folder and select Add > New Item…
  3. Choose Resource File and name it SfNumericEntry.fr-FR.resx for French localization.

Step 2: Add Localization Keys and Values

  1. Open the SfNumericEntry.fr-FR.resx file.
  2. In the Name column, add the following keys: return, go, next, done, send, search.
  3. In the Value column, enter the corresponding translated text.
Return button type Key Value
Default return retour
Go go aller
Done done terminé
Next next suivant
Search search rechercher
Send send envoyer

Step 3: Configure the Localization for NumericEntry

To apply the localization, set the ResourceManager for SfNumericEntryResources in the App.xaml.cs file.

namespace NumericEntrySample
{
   public partial class App : Application
   {
       public App()
       {
           InitializeComponent();

           // Set the current UI culture
           CultureInfo.CurrentUICulture = new CultureInfo("fr-FR");

           // Initialize the ResourceManager for SfNumericEntry
           SfNumericEntryResources.ResourceManager = new ResourceManager("NumericEntrySample.Resources.SfNumericEntry", Application.Current!.GetType().Assembly);
       }

       protected override Window CreateWindow(IActivationState? activationState)
       {
           return new Window(new AppShell());
       }
   }
}

Step 4: Initialize Numeric Entry control

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
            x:Class="NumericEntrySample.MainPage">

   <VerticalStackLayout Spacing="15" Padding="10">
       <inputs:SfNumericEntry 
               HeightRequest="40" 
               Background="Lavender"/>
   </VerticalStackLayout>
   
</ContentPage>

Output

NumericEntryLocalizationGIF.gif

Download the complete sample from GitHub

Conclusion

I hope you enjoyed learning how to change return button text for .NET MAUI Numeric Entry.
You can refer to our .NET MAUI Numeric Entry feature tour page to know about its other groundbreaking feature representations and Documentation, and how to quickly get started for configuration specifications.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied