Notifications
Clear all

[Closed] Tooltip with an Image

I’m trying to make a dotnet button’s tooltip to be an image, but I can’t get it to work no matter what I try. Here is my attempt:

fn TooltipPaint s e =
(
	theImage = dotNetClass "System.Drawing.Image"
	theBitmap = theImage.FromFile ("D:\Test.jpg")
	bmpRectangle = dotNetObject "System.Drawing.Rectangle" 0 0 240 240
	e.graphics.DrawImage theBitmap bmpRectangle
)
		
The_Button = dotNetObject "Button"
The_ToolTip = dotnetobject "ToolTip"
The_ToolTip.SetToolTip The_Button ""
dotnet.addEventHandler The_ToolTip "Draw" TooltipPaint

Can anyone help me find a way to accomplish this?

1 Reply

it can’t work your way.
you have to do custom drawing of tooltip using the ToolTip.Draw Event

here is an article where it’s done well (as i can see. at least i would do something similar):
https://www.codeproject.com/Articles/42050/ToolTip-With-Image-C