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

  • Home
  • SEARCH
  • 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 8387477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:13:19+00:00 2026-06-09T18:13:19+00:00

I have a PictureBox that has a map assigned to it (basically a list

  • 0

I have a PictureBox that has a map assigned to it (basically a list of Rectangle objects). Now I want to make it such if user moves the mouse over this picturebox, and if the mouse is over a rectangle that is existing in the list, a tooltip pop up and show some information.

The mapping works fine, but problem is the ToolTip is going crazy and does not show up properly, it just continues poping up with any mouse move. How can I code it such it only pop up when the mouse is in the rectangle?

This is my code and down there you see the example!

private void pictureBoxPackageView_MouseMove(object sender, MouseEventArgs e)
{
    if (PackageMap == null || PackageMap.Count == 0) return;
    var point = new Point(e.X, e.Y);

    foreach (var map in PackageMap)
    {
        if (map.Rectangle.Contains(point))
        {
            var tip = new ToolTip();
            tip.ToolTipTitle = map.Pin.Group;
            tip.Show("Result: " + map.Pin.Mk2Result, pictureBoxPackageView, point, 200);
            break;
        }
    }
}

enter image description here

  • 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-06-09T18:13:20+00:00Added an answer on June 9, 2026 at 6:13 pm

    It continuously pops up because you are only checking if the cursor is inside a rectangle. Remember that you can still move the mouse several times but your still within that rectangle.

    I think what you want is to pop up the tooltip only once when you enter a rectangle.
    You should remember the previous location of the mouse. If the current location is within a rectangle check if the previous location is not in the same rectangle. This is the time to display the tooltip otherwise pass.

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

Sidebar

Related Questions

I have a picturebox that has an image in it and a top of
I want to make a ListView that has small images, that was taken from
I have a userControl (.NET 1.1 Winforms) that has a clickable picturebox as a
I have a PictureBox that its size is fixed to 480x360 pixels. I write
I have a PictureBox control on a Form that is supposed to draw something
I have a task that runs periodically 10 second. I do some picturebox refreshing
Right now I have an application that loads a bunch of thumbnail images into
I have a class that represents the state of the world. The class has
Basically, i made a chessboard. i have 2 classes. the partial class, that triggers
I have a PictureBox with it's Dock set to Fill . I want to

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.