Good day,
Is there a way to detect a Double Click on the KCad control ? I have been searching for this and cannot find anything close.
Thanks.
Double Click notification
Re: Double Click notification
Hi Claude
We do not do anything with it inside.
See the attachment. It is an example of handling it in DIView sample. See the MessageFilter.vb and how it is added to the app in DIViewForm.New()
Double click in the case toggles visibility of the first object
We will add this to the next update
We do not do anything with it inside.
See the attachment. It is an example of handling it in DIView sample. See the MessageFilter.vb and how it is added to the app in DIViewForm.New()
Double click in the case toggles visibility of the first object
We will add this to the next update
Code: Select all
Imports System.Security.Permissions
Imports KernCADnet
Public Class MessageFilter
Implements IMessageFilter
Public Function PreFilterMessage(ByRef m As Message) As Boolean Implements IMessageFilter.PreFilterMessage
' if message is double-click
If m.Msg = WM_LBUTTONDBLCLK Then
' obtain cursor pos
Dim x As Integer = (m.LParam.ToInt32() And &HFFFF)
Dim y As Integer = (m.LParam.ToInt32() And &HFFFF0000) >> 16
' obtain control under ther cursor
Dim control As Control = form.GetChildAtPoint(New Point(x, y))
If TypeOf control Is AxKernCADnet.AxKernCADnet Then
Dim kernCAD As AxKernCADnet.AxKernCADnet = form.AxKernCADnet1
Dim iModel As IModel_DG = kernCAD.GetModel()
Dim iEntity As IEntity_DG = iModel.GetEntityAt(0)
Dim bVisible As Boolean = iEntity.IsVisible()
iEntity.SetVisible(Not bVisible)
kernCAD.UpdateView()
Return True
End If
End If
Return False
End Function
Public Sub New(formToFilter As DIViewForm)
form = formToFilter
End Sub
Private WM_LBUTTONDBLCLK As Integer = &H203
Private form As DIViewForm
End Class
Code: Select all
Public Sub New()
MyBase.New()
InitializeComponent()
Application.AddMessageFilter(New MessageFilter(Me))
End Sub
- Attachments
-
- DIView.zip
- (19.83 KiB) Downloaded 488 times