0

I've made an array of objects which I all want to preform an action when I'm interacting with a different object. Problem is that this overlaps the original object, yet I still want to see them. Basically what I want is an object which just acts as an invisible boundary, (like if I was to have a PictureBox over the top and set the image to Nothing and the BackColor as transparent (problem is that it appears transparency in windows forms doesn't exist and just makes it the form background colour)). Also setting Visible to False makes the object uninteractable.

TL;DR How do I make an object invisible but still intractable. Is there an object with the exact properties I'm describing I don't know about? Or a property to assign to an object. Thanks.

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
fox
  • 61
  • 9
  • You can use a custom control (derived from Panel, for example), override `CreateParams` and add the `WS_EX_TRANSPARENT` (= `&H00000020`) extended style to the parameters returned by `base.CreateParams`. This will give you a transparent object which will take the mouse clicks. – Jimi Mar 26 '19 at 13:55
  • Sample code related to what described in the previous comment [Transparent image over two controls with different back colors](https://stackoverflow.com/a/54261539/7444103). See the `TPanel` (transparent Panel) class used as support. – Jimi Mar 26 '19 at 17:46

0 Answers0