How do I make the control invisible but react to mouse events?
I want to create a control (derived from TCustomControl) that is invisible but reacts to normal events (I want to use it to show a hint when I move the mouse over a custom control). I thought that overriding the paint method and leaving it blank would do the job, but unfortunately the rectangle is drawn where the component is.
How can I make the control completely invisible?
source to share
You can inherit from TGraphicControl
instead of TCustomControl
and leave the paint handler empty. Nothing will be drawn.
If you want a windowed control, then you need to make sure it has no border and uses its parent background. See this question for information on how to do this. You may need to override CreateParams()
to remove the border style bit.
source to share