Results 1 to 4 of 4

Thread: Creating a right-click menu for Silverlight 4.

  1. #1
    Join Date
    Apr 2010
    Posts
    56

    Creating a right-click menu for Silverlight 4.

    I am going to generate something what I used to take for accessed in Winforms applications. Actually, I am a Silverlight noob, so according to me, all this is elementary.

    I have a listbox within a Silverlight 4 application . I would like to go for the below requirements :
    1-Right-click on the listbox .
    2-Have the components within the destination where I click highlight automatically..
    3- I would like a context menu to come-up (with my own components within the context menu) From my research , it shows that there is no ContextMenu construct in Silverlight, instead we have to generate up a Grid/Canvas designing and attach this to a Popup components that is what is then came up.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Creating a right-click menu for Silverlight 4.

    Silverlight 4 currently supports for the right click. After that you can get your own ContextMenu. Silverlight 4 toolkit contains one of the useful object known as ContextMenu control. You can simply make your own ContextMenu that involves-

    -MenuItem with Icon

    -Menu Separator

    You are now able to go for the Silverlight toolkit ContextMenuService that will manage the event and place adjustment of the ContextMenu..

  3. #3
    certain Guest

    Re: Creating a right-click menu for Silverlight 4.

    Thanks for prompt replies . I really got this to work. However, this moved me as it is with three different dilemmas.

    When I issue the right-click on an object specified , I require to make sure that what I right-clicked on and dependent on the selection, pare down the context menu list. How do I perform that? I would like for the context menu to pop up and MouseUp (just as different context menus), not on MouseDown event.
    Do you have any suggestion with the proper and executable example for generation of submenus as well as functioning ? Is it even possible with the ContextMenu control?

  4. #4
    Join Date
    May 2008
    Posts
    2,012

    Re: Creating a right-click menu for Silverlight 4.

    This is what I can provide , you mean implementing MouseRightButtonUp instead of MouseRightButtonDown?

    Code:
     public PrimaryPage()
      {
            InitializeComponent();
            this. MouseRightButtonUp += new MouseButtonEventHandler(PrimaryPage_MouseRightButtonUp);
      }
    
       void PrimaryPage_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
       {
            e.Handled = true;
       }
    instead of :

    Code:
     public PrimaryPage()
      {
            InitializeComponent();
            this. MouseRightButtonDown += new MouseButtonEventHandler(PrimaryPage_MouseRightButtonDown);
      }
    
      void PrimaryPage_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
      {
            e.Handled = true;
      }

Similar Threads

  1. Creating a Silverlight application with VS 2008
    By ChrisUlrich in forum Tips & Tweaks
    Replies: 2
    Last Post: 07-08-2010, 11:28 PM
  2. Creating a Catering Menu
    By Chesnokov in forum Windows Software
    Replies: 5
    Last Post: 17-07-2010, 12:46 PM
  3. Creating menu in joomla
    By Brunoz in forum Software Development
    Replies: 4
    Last Post: 06-03-2010, 08:08 PM
  4. right click problems with menu
    By Sortedfella in forum Windows Software
    Replies: 2
    Last Post: 11-08-2009, 09:03 AM
  5. How to disable right click menu?
    By Mozilla in forum Windows Software
    Replies: 5
    Last Post: 12-06-2009, 11:03 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,659,498.46745 seconds with 17 queries