@Terry_Chappell wrote:
I have a simple Eto form that we have been using to learn about Eto Forms. I want to add a MouseWheel event to a ComboBox control which enabling scrolling of the SelectedIndex for this control. To do this I added
MouseWheel = self.OnMouseWheel
to the control and included an event handler:def OnMouseWheel(self, sender, e): i = 1 if e.Delta > 0 else -1 next = min(2, max(0, self.n_combobox.SelectedIndex + i)) self.n_combobox.SelectedIndex = next
This works with .NET forms. The problem with the Eto Form is that the Python compiler complains:
Message: ComboBox() takes no arguments (5 given)
since it does not recognize MouseWheel as a legitimate argument for the control.
What is the proper way to add a MouseWheel event to the control on this Eto Form?
The complete form is here:
ETO Example Revised.py (7.9 KB)
Regards,
Terry.
Posts: 9
Participants: 3