[Closed] DotNet controls Picture Box
You didn’t read carefully… There is the solution in my post http://forums.cgsociety.org/showpost.php?p=6046649&postcount=30
This also works…
try(destroydialog dlg) catch()
rollout dlg ""
(
dotNetControl flp "flowlayoutpanel" height:60
fn whenButtonClick s e = (format "\"%\" clicked
" s.text)
fn makeButtons = for k=1 to 2 collect
(
btn = dotnetobject "button"
btn.text = "Layout B" + (k as string)
dotNet.addEventHandler btn "click" whenButtonClick
dotNet.setLifetimeControl btn #dotnet
btn
)
on dlg open do
(
local buttons = makeButtons()
flp.controls.addrange buttons
)
)
createdialog dlg
And so you don’t have to search for the difference, I’ll just tell you. Look up dotNet.setLifetimeControl in the help doc. This was added in 2010 specifically to fix this problem. Setting the lifetime control to #dotnet mean that the even handlers don’t get garbage collected by Max.
dotNet.setLifetimeControl
well … the only reason I was happy that they added this thing was to free the tag property for the timer… but ,well, it doesn’t work…
edit : Ho well , it does work now …but I swear it wasn’t the other day… I’ll try to find back what I was doing …:rolleyes:
wow!!! , thats it!
How I miss it ?(one local variable…)
Finaly I can continue on my project…:applause:
You have right denisT (NEVER let MAX kick my a$$!!! :-))))))
Many Thanks for This!