I’ve placed a (custom) .NET slider control (“trackbar” in Windows.Forms parlance) on my MaxScript dialog. I want to be able to detect a click&drag event on the slider and update a MaxScript spinner appropriately. The problem is I can’t figure out how to detect the event.
I thought I’d use the dotNet.AddEventHandler() method, but that only works for dotNetObjects, not dotNetControls. I’ve had limited success using a MaxScript event handler, like:
on tb_Test click do (
messageBox “Click worked!”
)
That works, but on fires off on the end of a click event (e.g. mouseUp). It isn’t appropriate for polling the control during a mouse move event.
For activeX controls Max has quite a few native event handlers like Click, KeyDown, KeyPress, KeyUp, BeforeClick, OLEStartDrag, OLECompleteDrag, OLEDragOver, etc… Other than Click none of these seem to work with my .NET trackbar control.
How do I go about making a workable event handler for this control?