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 3394132
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:08:01+00:00 2026-05-18T04:08:01+00:00

my program has a picturebox, and I want, apon a mouse click, or on

  • 0

my program has a picturebox, and I want, apon a mouse click, or on ContextMenuStrip choice, to make something appear at the same spot of the click.

as seen in the picture, i would like to add some kind of a note on the specific clicked date area (probably add a user control)

How do i go at it ? how can i send the click cordinates (x,y) and make something appear at these same coordinates ?

Thanks !

alt text

  • 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-18T04:08:02+00:00Added an answer on May 18, 2026 at 4:08 am

    I would create a class which would provide menu items and capture x,y coordinates to have them ready when the item is clicked. Or you can capture these coordinates in an anonymous delegate.

    Something like this:

    public Form1()
    {
        InitializeComponent();
        MouseClick += new MouseEventHandler(Form1_MouseClick);
    }
    
    private void Form1_MouseClick (object sender, MouseEventArgs e)
    {
        if (e.Button == MouseButtons.Right)
        {
            ContextMenuStrip ctxMenu = new ContextMenuStrip();
    
            // following line creates an anonymous delegate
            // and captures the "e" MouseEventArgs from 
            // this method
            ctxMenu.Items.Add(new ToolStripMenuItem(
               "Insert info", null, (s, args) => InsertInfoPoint(e.Location)));
    
            ctxMenu.Show(this, e.Location);
        }
    }
    
    private void InsertInfoPoint(Point location)
    {
        // insert actual "info point"
        Label lbl = new Label()
        {
            Text = "new label",
            BorderStyle = BorderStyle.FixedSingle,
            Left = location.X, Top = location.Y
        };
        this.Controls.Add(lbl);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My program has 3 text fields, Title, Website, and PictureURL. When I click the
My program has two targets and I want to correctly configure this screen: I
My program has code that saves attachments, I want these attachments to be transferred
My program has a grid of cells and I want to be able to
When an iPhone program has something like a paragraph or a set of instructions
I want to write a warehouse program which has near 80 clients.My program has
My program has two forms which get data from the same data source. After
My program has a tableview, I want to show selected items from the tableview
My program has to use certain files that reside in another directory. Right now
My program has two threads: Main execution thread that handles user input and queues

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.