locked
Custom Style PopupMenu RRS feed

  • Question

  • Is there a way to customize the style of PopupMenu?  I want to put some long text in a PopupMenu, but it seems there is a limit of the width that truncates the long text.  Also, I want to change the fontsize of context menu.  Is it possible?
    Sunday, September 15, 2013 5:37 AM

Answers

  • Hi Albert,

    Why do you need a long text as a command? And UICommand is not a control, so no UI support, for this reason I don't think you could modify the fontsize or width of the PopupMenu in C#, but MSDN also mentioned it is possible by WinJS.

    To customize the context menu, call preventDefault on the oncontextmenu event (e in the example) to suppress the default context menu, and then create a new, empty context menu menu as shown in the Context menu sample.

    And if you need a customized popupmenu, to use Flyout is a good option, also MenuFlyout in win8.1 as a new feature.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Albert Pun Monday, September 16, 2013 5:27 PM
    Monday, September 16, 2013 2:54 AM
    Moderator

All replies

  • Hi Albert,

    Why do you need a long text as a command? And UICommand is not a control, so no UI support, for this reason I don't think you could modify the fontsize or width of the PopupMenu in C#, but MSDN also mentioned it is possible by WinJS.

    To customize the context menu, call preventDefault on the oncontextmenu event (e in the example) to suppress the default context menu, and then create a new, empty context menu menu as shown in the Context menu sample.

    And if you need a customized popupmenu, to use Flyout is a good option, also MenuFlyout in win8.1 as a new feature.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Albert Pun Monday, September 16, 2013 5:27 PM
    Monday, September 16, 2013 2:54 AM
    Moderator
  • Hi James,

    I think Flyout is the feature I'm looking for that can display some detail info to the user and dismiss it by clicking anywhere of the screen.   Both context menu and tooltip in Win8 accomplish similar feature, but not exactly what I need.  I guess I have to implement it by myself as flyout in Win8.1?

    Thanks,

    Albert

    Monday, September 16, 2013 5:27 PM