C1Schedule: HowTo change Font family and size

Posted by: SHanau on 29 November 2019, 10:30 am EST

    • Post Options:
    • Link

    Posted 29 November 2019, 10:30 am EST

    Hi,

    Could you please show me how to change the font size of C1Schedule and C1Calendar ?

    Thanks in advance,

    Stephan

  • Posted 2 December 2019, 2:52 am EST

    Hello,

    You can set the font property as given in the code snippet below :

    c1Schedule1.Font = new Font("", 15,FontStyle.Bold);
    c1Calendar1.Font = new Font("", 15, FontStyle.Bold);
    

    We can observe that Font property is not present in the designer of both the controls so we have escalated this to the developers, will let know once it is done. [Internal Tracking ID : 408937]

    For the time being you can use the above given solution to set the Font.

    Regards,

    Prabhat Sharma.

  • Posted 6 December 2019, 8:06 am EST

    Hello,

    We are happy to inform you that we have got the response from the developers and according to them :

    You can change fonts at design-time from VisualStyle smart designers:

    https://www.grapecity.com/componentone/docs/win/online-schedule/c1calendarsmartdesig.html

    https://www.grapecity.com/componentone/docs/win/online-schedule/c1schedulesmartdesig.html

    If you change Calendar’s Font or Scheduler’s BaseFont in smart designers, that change will affect all different Calendar and Schedule parts.

    C1Calendar.Font and C1Schedule.Font properties are only used internally to honor ambient font settings. For example, if some application will set big font size for the form, C1Calendar and C1Schedule controls will scale fonts accordingly. But they won’t change font faces and other font attributes.

    If you need any other help, please let us know.

    Regards,

    Prabhat Sharma.

  • Posted 6 December 2019, 8:56 am EST

    Hello,

    Thanks for your help yet the suggested solution doesn’t work. Even though I’ve set the font as explained by your example, the font size of both C1Schedule and C1Calendar won’t change. Do I have to change some other settings (e.g. AutoScaleMode of the host form) in order to achieve the effect ?

    Best regards,

    Stephan

  • Posted 6 December 2019, 9:52 am EST - Updated 4 October 2022, 12:24 am EST

    Hello,

    My previous posting was a little bit premature. I hadn’t noticed your last reply. Sorry for that yet I still have got a problem with the font size.

    My app works as an MDI app. So there’s this superior MDI form and the calendar form as its child. After having changed the font size in the designer as suggested I do get the look I want to accomplish. Yet at run-time it looks quite different. Please notice the enlarged font size of C1Calendar itself and the diminished font size of C1Schedule’s tabs and day names. Please advise.

    Thanks in advance,

    Stephan

  • Posted 9 December 2019, 7:15 am EST

    Hello,

    Sorry we could not replicate the issue at our end when setting the Font in the designer and we could see the exact font at run time.

    We are attaching a demo sample that is working fine at our end. It will be very helpful if you could modify the attached sample or provide your stripped down sample replicating the issue so that we can provide you a helpful solution.

    Please mention the build version of the control that you are using with the environment details.

    Regards,

    Prabhat Sharma.

    ScheduleFontDemo.zip

  • Posted 14 December 2019, 11:26 am EST

    Hello,

    Thanks very much for the example. It helped me to figure out the issue.

    Your example works because it doesn’t has to react to any visual style changes. But as I mentioned before I’m developing an MDI app. Our users are able to choose between all built-in C1Ribbon visual styles. These styles are then cascaded down to the MDI children. So, as long as the user doesn’t apply a new visual style C1Schedule works fine. But as soon as I apply a new visual style all changes are gone.

    I understand that I can use the designer to change the font sizes of all themes but I can’t figure out how to save those changes to C1Schedule. When I close and re-open the underlying form, only the most recent edited theme is still present as it is stored in the form’s .resx file. But all the others changes previously made have vanished.

    The built-in designer seems to be a little bit buggy. Some issues I’ve experienced:

    • Every change of C1Schedule’s properties creates a new theme with a unique name with an underscore in its name to separate it from its origin. But editing an already edited theme creates a new theme as well instead of using the same name again. So I can’t edit the same theme more than once.
    • Attemps to change more than one standard theme in one session creates different theme names. For example: I’m using the Office 2007 Blue theme as template for my own theme. I named it Office2007Blue10 without any spaces in-between. I’m getting an error screen stating that this name doesn’t correspond to certain naming conventions. So the name is getting changed to Office2007Blue10_ with an underscore. A second attempt to edit this newly created theme end with its name changed to Office2007Blue10__ (with 2 underscores). So now I’ve got 2 separate new Office 2007 Blue themes. Now when I use Office 2007 Black as template for any changes and do exactly the same with naming it Office2007Black10 no error screen appears and no underscore is being added. But strangely, afterwards there are now 2 themes in the theme’s drop-down box both with the name Office 2007 Black.

    Obviously to avoid this I could save every changed theme into a separate .xml file but how would I load and apply it during run-time ?

    I’m using C1Schedule 4.0.20193.393. Please advise.

  • Posted 16 December 2019, 7:40 am EST

    Hello,

    When any Visual style is applied to the control, it uses the the Font value associated with that Visual Style that is why the Font is changing when the visual style changes.

    You can load your custom visual styles into the project’s Resource file and use it from there as shown in the attached GIF. A demo sample is also for reference, please have a look.

    About that naming issue where underscore comes automatically in the custom visual style name, we are discussing it with the developers and will let you know once it is done.[Internal Tracking ID : 413266].

    Regards,

    Prabhat Sharma.

    demo.zip

  • Posted 16 December 2019, 12:51 pm EST

    Hello Prabhat,

    I really appreciate your service.

    Thank you very much for the demo. It works perfectly for me.

    Regards,

    Stephan

Need extra support?

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

Learn More

Forum Channels