Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4249018
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:20:25+00:00 2026-05-21T04:20:25+00:00

Goal: Right clicking in the listview and choose different option. Problem: There are two

  • 0

Goal:
Right clicking in the listview and choose different option.

Problem:
There are two problem:
*When I’m right clicking, the left corner of the menu is not exactly located in the arrow’s spot location.
*How do I create a line in the menu?

The main problem about the menu

The menu is not located in the right spot once you are right clicking

Need support to create these two redmark.

Request to fulfill these two red marked

private void lstV_Stock_MouseUp(object sender, MouseEventArgs e)
{
    switch (e.Button)
    {

        // Right mouse click
            case MouseButtons.Right:


                ContextMenu myContextMenu = new ContextMenu();

                MenuItem menuItem1 = new MenuItem("New product");
                MenuItem menuItem2 = new MenuItem("Delete");
                MenuItem menuItem3 = new MenuItem("Add quantity");


                // Clear all previously added MenuItems.
                myContextMenu.MenuItems.Clear();

                myContextMenu.MenuItems.Add(menuItem1);
                myContextMenu.MenuItems.Add(menuItem2);
                myContextMenu.MenuItems.Add(menuItem3);

                if (lstV_Stock.SelectedItems.Count > 0) 
                {

                    foreach (ListViewItem item in lstV_Stock.SelectedItems)
                    {
                        myContextMenu.MenuItems[1].Visible = true;
                        myContextMenu.MenuItems[2].Visible = true;
                        myContextMenu.MenuItems[0].Visible = false;
                    }

                }
                else
                {
                    myContextMenu.MenuItems[1].Visible = false;
                    myContextMenu.MenuItems[2].Visible = false;
                    myContextMenu.MenuItems[0].Visible = true;
                }

                myContextMenu.Show(lstV_Stock, this.PointToClient(Cursor.Position), LeftRightAlignment.Right);



                menuItem1.Click += new System.EventHandler(this.menuItem1_Click);


                break;

        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:20:25+00:00Added an answer on May 21, 2026 at 4:20 am

    For the positioning, you can replace your

    myContextMenu.Show(lstV_Stock, this.PointToClient(Cursor.Position), LeftRightAlignment.Right);
    

    to

    myContextMenu.Show(lstV_Stock, e.Location(), LeftRightAlignment.Right);
    

    or the point e.X,e.Y. Not from this.PointToClient, but from the MouseEventArgs generating the event. You can check wahat MouseEvent have here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goal: Display different context menu if right clicking a row from the listview or
I have a problem in choosing the right method to accomplish my goal. I'm
iam not sure if iam doing it the right way. My Goal is to
Right now I have two activities. My goal is to allow the user to
my goal i want to translate a left click to a right click my
Hi all my goal is to get the child menu expanded towards the left
Am i right in thinking regex routes have been superseeded by route constraints? there
My goal is to display the same icon twice, but each time in different
We currently have a Web Forms application deployed on IIS. Our goal right now
All right. The problem here is pretty abstract. Bear with me. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.