disable FontAutoScalingEnabled

Anyone knows how to disable autoscaling on sfcombobox? I set property on style.xaml file for every control but for displymember in Combobox this has no effect


3 Replies

BV Brundha Velusamy Syncfusion Team March 18, 2024 02:06 PM UTC

Hi Marco,


We can set the FontAutoScalingEnabled property as false to the entry through the SfComboBox children to disable the font auto scaling in the SfComboBox input field as shown in the code snippet below.


Please refer to the below code snippet for this,

if(comboBox!=null)

{

    var inputView = (comboBox.Children[1] as Entry);

    if(inputView!=null)

    {

        inputView.FontAutoScalingEnabled = false;

    }

}


Regarding the font size of drop-down items, by default, they do not change based on system font size changes in our testing. However, if you encounter situations where the drop-down item font size changes based on system font size changes, please provide further details. Additionally, you can set the font size for SfComboBox drop-down items using the DropDownItemFontSize property, as illustrated in the code snippet below:


Please refer to the below code snippet for this,

<editors:SfComboBox IsEditable="True"

                    x:Name="comboBox"

                    DropDownItemFontSize="16"

                    ItemsSource="{Binding RoomsRemarksCustomData}"

                    Text="{Binding Text,Mode=TwoWay}">

</editors:SfComboBox>


For your convenience, we have included the sample as an attachment. Kindly review the attached file and inform us if you have any concerns. If your requirements differ from the suggested solution, kindly provide detailed specifications to facilitate a more effective investigation and solution.


Regards,

Brundha V


Attachment: ComboBoxMaui_(2)_f72ae70.zip


MA Marco March 18, 2024 03:18 PM UTC

thanks to much  Brundha



PR Preethi Rajakandham Syncfusion Team March 19, 2024 06:41 AM UTC

Hi Marco,

You're welcome. Please let us know if you need further assistance. As always, we are happy to help you out. 

Regards,

Preethi R


Loader.
Up arrow icon