.NET5 C1DateTimePicker FontSize

Posted by: info on 24 October 2021, 6:51 pm EST

    • Post Options:
    • Link

    Posted 24 October 2021, 6:51 pm EST - Updated 4 October 2022, 8:36 am EST

    Hello.

    C1.WPF.Input.Ja 5.0.20212.110

    How to change the fontsize and the dropdown button size?

    The FontSize Property does not work. Is this a bug?

    Thank you.

  • Posted 26 October 2021, 3:35 am EST

    Hi,

    Thank you for providing the snapshot.

    1. This behavior is bug, and we escalated this behavior with the development team. We’ll get back to you once we have any update.[Internal Tracking Id: C1XAML-28248]

    However, as a workaround you can set FontSize of C1MaskedTextBox inside it. You can find C1MaskedTextBox from C1DatePicker’s template and then you can easily set FontSize on C1MaskedTextBox as :

    
    private void DatePicker_Loaded(object sender, RoutedEventArgs e)
            {
                var dtPicker = sender as C1DatePicker;
                var txtBox = dtPicker.Template.FindName("TextBox", dtPicker) as C1MaskedTextBox;
                
                txtBox.FontSize = 24;          
            }
    
    
    1. For ToggleButton’s content size, you need to handle Loaded event of C1DatePicker and find the toggle button from its template. Now you can set toggle button’s content size accordingly.

      JFYI, fontsize will not work on toggle button, because toggle button have path in its content. (see code snippet)
    
    private void DatePicker_Loaded(object sender, RoutedEventArgs e)
            {
                var dtPicker = sender as C1DatePicker;           
                var button = dtPicker.Template.FindName("Button", dtPicker) as C1ToggleButton;
    
                (button.Content as ContentControl).Height = 20;
                (button.Content as ContentControl).Width = 20;
            }
    
    

    Please refer the attached sample for the same : C1DatePickerFontSize.zip

    Best Regards,

    Nitin

  • Posted 28 October 2021, 3:25 am EST

    Thank you for your help.

  • Posted 7 December 2021, 6:07 am EST

    Hi,

    We are happy to inform you that this issue has been fixed with the latest build 2021v3.

    So, we would request you to upgrade to the latest build using ComponentOne control panel. Just in case if you don’t have ComponentOne Control Panel, you can download it from https://www.grapecity.com/componentone/download.

    Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels