how to save x and y coordinates when doing a right click in C#
my goal is to open a ContextMenuStrip on right click remember this click x and y and then on clicking on one of the given items to do something
till now this is what i have done :


        public delegate void mydelegate(string s);
           public Form1()
          {
            InitializeComponent();
            m_MyContextMenuStrip = new ContextMenuStrip();
            m_MyContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(cms_Opening);
            this.ContextMenuStrip = m_MyContextMenuStrip; 
         }


            void cms_Opening(object sender, System.ComponentModel.CancelEventArgs e)
        {
            m_MyContextMenuStrip.Items.Clear();

            location1 = m_MyContextMenuStrip.PointToClient(new Point(0, 0));
            location = m_MyContextMenuStrip.PointToScreen(new Point(0, 0));
            // Populate the ContextMenuStrip control with its default items.
            m_MyContextMenuStrip.Items.Add("-");
            m_MyContextMenuStrip.Items.Add("Apples");
            m_MyContextMenuStrip.Items.Add(location.X.ToString() + "and  " + location.Y.ToString());
      
            m_MyContextMenuStrip.Items.Add("aaaa", null, new EventHandler(onaaaClick));
            // Set Cancel to false. 
            // It is optimized to true based on empty entry.
            e.Cancel = false;
        }

              private void onaaaClick(object sender, EventArgs e)
        {
            //will handle the click on aaa
            
            Form2 f2 = new Form2(functodel);
            f2.Show();

        }


        void functodel(string s)
        {
            Label l = new Label();
            l.Text = s;

            l.Top = location.Y - 108;
            l.Left = location.X - 100;
            //l.Left = this.Location.X - location.X;  

            l.BorderStyle = BorderStyle.FixedSingle;
            this.Controls.Add(l);
            l.BringToFront();

        }


where Form2 is :

          private mydelegate m_del;
        public Form2(mydelegate del)
        {
            m_del = del;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            m_del(textBox1.Text);
            this.Close();
        }


my problem is when i click on the right click i am not getting the location i want ' i am getting another location can someone explain to me what am i doing wrong ?

1.how to get the right location.

2.how to get a ContextMenuStrip where i had only once an item ?

3.let's say on the given label i am righting i want to click on the right click and get another optiones then in m_ContextMenuStrip (delete item and change color... )how do i do that ? 



how to save x and y coordinates when doing a right click in C#
===

my goal is to open a ContextMenuStrip on right click remember this click x and y and then on clicking on one of the given items to do something
till now this is what i have done :


        public delegate void mydelegate(string s);
           public Form1()
          {
            InitializeComponent();
            m_MyContextMenuStrip = new ContextMenuStrip();
            m_MyContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(cms_Opening);
            this.ContextMenuStrip = m_MyContextMenuStrip; 
         }


            void cms_Opening(object sender, System.ComponentModel.CancelEventArgs e)
        {
            m_MyContextMenuStrip.Items.Clear();

            location1 = m_MyContextMenuStrip.PointToClient(new Point(0, 0));
            location = m_MyContextMenuStrip.PointToScreen(new Point(0, 0));
            // Populate the ContextMenuStrip control with its default items.
            m_MyContextMenuStrip.Items.Add("-");
            m_MyContextMenuStrip.Items.Add("Apples");
            m_MyContextMenuStrip.Items.Add(location.X.ToString() + "and  " + location.Y.ToString());
      
            m_MyContextMenuStrip.Items.Add("aaaa", null, new EventHandler(onaaaClick));
            // Set Cancel to false. 
            // It is optimized to true based on empty entry.
            e.Cancel = false;
        }

              private void onaaaClick(object sender, EventArgs e)
        {
            //will handle the click on aaa
            
            Form2 f2 = new Form2(functodel);
            f2.Show();

        }


        void functodel(string s)
        {
            Label l = new Label();
            l.Text = s;

            l.Top = location.Y - 108;
            l.Left = location.X - 100;
            //l.Left = this.Location.X - location.X;  

            l.BorderStyle = BorderStyle.FixedSingle;
            this.Controls.Add(l);
            l.BringToFront();

        }


where Form2 is :

          private mydelegate m_del;
        public Form2(mydelegate del)
        {
            m_del = del;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            m_del(textBox1.Text);
            this.Close();
        }


my problem is when i click on the right click i am not getting the location i want ' i am getting another location can someone explain to me what am i doing wrong ?

1.how to get the right location.

2.how to get a ContextMenuStrip where i had only once an item ?

3.let's say on the given label i am righting i want to click on the right click and get another optiones then in m_ContextMenuStrip (delete item and change color... )how do i do that ? 


