Hello,
Is there a way to visually show a form while having it not “listen” for mouse events or prevent mouse interaction with the form. (I know this sounds a bit counter intuitive)
I have a form that is supposed to close on MouseUp and works overall unless the user mouse is hovering on the form itself when MouseUp occurs, if this happens, the form stays and does not close until I instantiate the form again (since I run a function to close any active form prior to creating a new one)
Mouse Up Code:
def OnMouseUp(self, e):
if e.Button == System.Windows.Forms.MouseButtons.Middle:
if self.mouse_moved:
self.original_position = None
if self.form:
selected_index = self.form.selected_button_index
# Close the form first
self.form.Close()
self.form = None
if selected_index is not None:
# Execute the corresponding Rhino command
commands = ["Floor", "Wall", "Door", "Window", "Electrical", "Plumbing", "Object", "Room"]
Rhino.RhinoApp.WriteLine("Running {} tool...".format(commands[selected_index]))
if selected_index < len(commands):
Rhino.RhinoApp.RunScript(commands[selected_index], False)
else:
Rhino.RhinoApp.WriteLine("No command found for index {}.".format(selected_index))
elif self.form:
# If mouse hasn't moved, close the form
self.form.Close()
self.form = None
Thank you all for your help!