[Closed] event handlers for run time objects
Does anyone know how to add an event handler to a dotnet object that is created at run time? I am creating a series of comboboxes at run time and I would like them all to use the same drawitem function.
Hi,
I think you have to use the “on ComboBox DrawItem arg do” event handler.
Are you creating these controls in a rollout or a form ? Using RolloutCreator structure ?
[color=maroon]
[/color]
I am creating them on a form. At design time I would use…
dotNet.AddeventHandler combobox "drawitem" My_drawitem_function
I put this in code right after I create a combobox but it never triggers. VB.Net uses an AddHandler statement but I don’t beleive maxscript supports it.
Hi,
Can you provide your code if it’s possible ?
Thanks in advance.
Yannick
Well, I’m not sure what I was doing before but the sample code I was putting together to post worked fine. Sorry to waste your time.
Hi,
dotNet wrapper behaviour is sometimes strange. Especially I had a lot of errors/problems with dotNet forms. So I avoid using them in MAXScripts and I prefer dotNetControl instruction to insert a managed control into a rollout. It’s a better and more efficient solution but in your case it’s not possible.