
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got an issue with my addin form. It will open when clicking on the addin button on my custom panel, but only on the first time after starting a new instance of Inventor.
This code is contained with the StandardAddInServer
Dim MyForm As New Form1
' Sample handler for the button.
Private Sub m_sampleButton_OnExecute(Context As NameValueMap) Handles m_sampleButton.OnExecute
DisplayForm()
End Sub
Private Sub DisplayForm()
MyForm.TopMost = True
MyForm.Show()
MyForm.BringToFront()
End Sub
This is my form code:
Imports Inventor
Public Class Form1
Dim newpoint As New System.Drawing.Point
Dim x, y As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Close()
End Sub
Private Sub Panel1_MouseDown(sender As Object, e As Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
x = MousePosition.X - Me.Location.X
y = MousePosition.Y - Me.Location.Y
End Sub
Private Sub Panel1_MouseMove(sender As Object, e As Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
newpoint = MousePosition
newpoint.X -= (x)
newpoint.Y -= (y)
Me.Location = newpoint
End If
End Sub
End Class
It's like after I execute the Button1_Click sub, the m_sampleButton_OnExecute sub no longer works.
Any pointers as to where I'm going wrong?
Solved! Go to Solution.