Hi,
I'm having a strange problem with the OnClick event. In an ArcGIS application using VB.Net, I have a button set up with the following code:
AddItem("CommandAnalyseResults")
The following module segment contains the OnClick event:
Public NotInheritable Class CommandAnalyseResults
Inherits BaseTool
<more code...>
Public Overrides Sub OnClick()
If (mForm Is Nothing) Then
mForm = New FormAnalyseResults(Me, m_application)
End If
' Creates a new object if user has closed window
If mForm.IsDisposed Then
mForm = New FormAnalyseResults(Me, m_application)
End If
mForm.Show(NativeWindow.FromHandle(New IntPtr(GetHWndForCurrentApplication))) 'APB edits for parent/child form handling
End Sub
etc...
The OnClick event gets triggered no problem the first time I click on the button.
However if I then close the window the button code creates and then click on the button again, the OnClick code is not triggered.
If I click on a different button then click back on the 'problem' button a 2nd time, it does seem to trigger the code!
Any ideas what could be causing this and how to get around it?
Many thanks
Simon
I'm having a strange problem with the OnClick event. In an ArcGIS application using VB.Net, I have a button set up with the following code:
AddItem("CommandAnalyseResults")
The following module segment contains the OnClick event:
Public NotInheritable Class CommandAnalyseResults
Inherits BaseTool
<more code...>
Public Overrides Sub OnClick()
If (mForm Is Nothing) Then
mForm = New FormAnalyseResults(Me, m_application)
End If
' Creates a new object if user has closed window
If mForm.IsDisposed Then
mForm = New FormAnalyseResults(Me, m_application)
End If
mForm.Show(NativeWindow.FromHandle(New IntPtr(GetHWndForCurrentApplication))) 'APB edits for parent/child form handling
End Sub
etc...
The OnClick event gets triggered no problem the first time I click on the button.
However if I then close the window the button code creates and then click on the button again, the OnClick code is not triggered.
If I click on a different button then click back on the 'problem' button a 2nd time, it does seem to trigger the code!
Any ideas what could be causing this and how to get around it?
Many thanks
Simon