You can deal with it by placing an Owned Form with 1% opacity in front of your main form, to capture the mouse events. An Owned Form stays linked with its owner in the Z order. You need to code the X and Y bounds in the main form's Move event etc. Here's example:
Code:
Public Class Form1
Private WithEvents Form2 As New Form
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
With Form2
.FormBorderStyle = Windows.Forms.FormBorderStyle.None
.ShowInTaskbar = False
.Opacity = 0.01
.Show(Me) 'show Form2 with Owner (Me)
End With
End Sub
Private Sub Form1_MoveEtc(sender As Object, e As System.EventArgs) Handles Me.Move, Me.SizeChanged, Me.Shown
Form2.Bounds = Me.RectangleToScreen(Me.ClientRectangle)
End Sub
Private Sub Form2_MouseClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Form2.MouseClick
If Me.Panel1.Bounds.Contains(e.Location) Then
'your panel click action here
End If
End Sub
End Class
For debugging purposes, set Form2's opacity to e.g. 0.1 instead of 0.01. As an alternative to coding Form2's mouse events, you can make the area of Form2 corresponding to the Panel on Form1 transparent by using Form2's TransparencyKey. Then you can handle all the Panel's mouse events directly.
BB