ContextMenu: theme not applied

Posted by: fsegui on 7 July 2020, 10:51 am EST

    • Post Options:
    • Link

    Posted 7 July 2020, 10:51 am EST - Updated 3 October 2022, 11:46 pm EST

    Hello,

    I’m using C1ThemeController and C1ContextMenu. I’ve defined a custom theme that applies well on all components (C1MainMenu, C1Button…) except C1ContextMenu which never change.

    VisualStyle is set on “Custom” and theme to Default.

    Why is it not taken into account?

  • Posted 8 July 2020, 4:23 am EST

    Hi Florent,

    Sorry, but we do not face the issue at our end in applying the custom theme to C1ContextMenu.

    Please see the attached sample which is running fine at our end and let us know if you are doing something else and modify the sample accordingly.

    Regards,

    Prabhat Sharma.

    ContextMenuTheme.zip

  • Posted 8 July 2020, 7:43 am EST

    Hi Prabhat Sharma,

    Actually, I was creating the C1ContextMenu programmatically. What i forgot to do was applying the custom theme as it was not taken into account automatically.

    I’ve added the two lines :

    string theme = c1ThemeController1.GetTheme(this);

    c1ThemeController1.SetTheme(c1ContextMenu, theme);

    Thanks

    c1ContextMenu = (C1ContextMenu)c1CommandHolder1.CreateCommand(typeof(C1ContextMenu));
                c1ContextMenu.VisualStyle = C1.Win.C1Command.VisualStyle.Custom;
    string theme = c1ThemeController1.GetTheme(this);
                c1ThemeController1.SetTheme(c1ContextMenu, theme);
                C1.Win.C1Command.C1Command command = c1CommandHolder1.CreateCommand();
    
Need extra support?

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

Learn More

Forum Channels