ToolTip on same control

Christ Kennedy 196 Reputation points

writing in C#, I've created a class that displays its own 'objects' onto a single picturebox in a way similar to how C# creates objects and puts them on a form. (it uses a Sweep & Prune algorithm to detect what object is under the mouse and is intended to be similar to regular VS objects like Label, Button, ComboBox, etc...)

I have a ToolTip object but there is only the one PictureBox Control for it to associate with.
at the ToolTip_PopUp() event it asks itself 'what object is under the mouse' (still in the same PictureBox) but since the VS ToolTip only triggers the PopUp event when it detects a new control (different from the last) under the mouse I can't get the ToolTip to trigger twice on the same PictureBox for two different 'regions' (my objects) on it.
I've tried setting the ToolTip.Active property Off/On whenever the mouse moves over this PictureBox but that doesn't seem to be working either.

the PopUp_Event() works fine when it is triggered but ToolTip won't trigger twice on the same control.
is there a way to 'Reset' the ToolTip and get it to do its business more than once on the same control?

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,627 questions
{count} votes

Accepted answer
  1. Christ Kennedy 196 Reputation points

    I changed my object to a panel and added two identical PictureBoxes to it.
    by alternating which PictureBox is in front every time the mouse moves over a different 'object' (region on picturebox) the ToolTip detects a new Control (PictureBox in front of the previous one) it summons the ToolTip_Event.

    problem solved.

    0 comments No comments

0 additional answers

Sort by: Most helpful