hello,
I'm trying to figure out how to add a ToolTip to a RectangleF, so when the user moves the mouse over the rectangle a tooltip with information regarding that rectangle will pop up. I hope someone out there knows how to do this. For example this is what I have:
However, this gives an error because RectangleF is not a user control. So, is the best solution to make another class like Rectangle but is a user control, and if so how? Or, is there a component that I could use (like a button)? However, it is important that the control be able to use floats for the location, width, and height, which eliminates the Button control.
Not sure how to do this using floats to designate the SizeF and Location? Hope someone can help.
Thank you,
Joe
I'm trying to figure out how to add a ToolTip to a RectangleF, so when the user moves the mouse over the rectangle a tooltip with information regarding that rectangle will pop up. I hope someone out there knows how to do this. For example this is what I have:
Code:
private void Form1_Paint (object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
RectangleF r = new RectangleF(20.5, 20.3, 100.45, 200.68);
e.FillRectangle(Brushes.Red, r);
ToolTip myTip = new ToolTip();
myTip.SetToolTip(r, "This is my Red RectangleF");
}
Not sure how to do this using floats to designate the SizeF and Location? Hope someone can help.
Thank you,
Joe
Comment