I've found an alternative way to do this. It seems a lot easier to implement, but I am not sure if it is more efficient, reliable, etc, so I will leave that up to more knowledgeable people to discuss.
The techniques used in this thread seemed too beyond me, so I thought maybe instead of going too deep into the AutoCAD API, I could use the Windows API to first detect if the left mouse button was clicked, then use the AutoCAD API to see if any objects are selected. It is slightly more involved than normal to detect a mouse click outside your form/control, but after a bit of searching I found an easy method that works. Here is what I did:
1) Declare function "GetAsyncKeyState" from the user32 library
2) Add a timer to my control
3) Within the Timer1_Tick sub, use GetAsyncKeyState to see if the left-mouse button is down.
4) If the left mouse button is down, see if objects are selected, see if any of the objects are of the type I care about, display properties, etc.
Here's the code:
Imports Spaces.SpaceClass
Public Class SpaceControlForm
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(1) = 0 Then
' Label1.Text = "Left mouse button up"
Else
' Label1.Text = "Left mouse button down"
MouseOverControl()
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
End Class
The MouseOverControl sub just checks what, if any, entities are selected (using myEditor.SelectImplied) and then displays some properties of the entities I care about.