标签:control show window box ati end click controls button
struct maxFormBuilderStruct
(
theFrm = dotNetObject "MaxCustomControls.MaxForm"
,theBtn = dotNetObject "System.Windows.Forms.Button"
,fn theFunc = messageBox "123"
,on create do
(
DotNet.AddEventHandler this.theBtn "click" this.theFunc
this.theFrm.controls.add this.theBtn
this.theFrm.Show(theHwnd)
)
)
--maxFormBuilderStruct()
------------------------------------------------------------
rollout maxFormBuilderRoll ""
(
local theFrm = dotNetObject "MaxCustomControls.MaxForm"
local theBtn = dotNetObject "System.Windows.Forms.Button"
fn theFunc = messageBox "456"
fn init =
(
DotNet.AddEventHandler theBtn "click" theFunc
theFrm.controls.add theBtn
theFrm.Show(theHwnd)
)
)
--maxFormBuilderRoll.init()
------------------------------------------------------------
fn maxFormBuilderFunc =
(
local controls = #()
local theFrm = dotNetObject "MaxCustomControls.MaxForm"; append controls theFrm
local theBtn = dotNetObject "System.Windows.Forms.Button"; append controls theBtn
theFrm.controls.add theBtn
thePtr = DotNetObject "System.IntPtr" (windows.getMAXHWND())
theHwnd = (dotNetObject "System.Windows.Forms.NativeWindow").FromHandle thePtr
fn theFunc = messageBox "789"
DotNet.AddEventHandler theBtn "click" theFunc
theFrm.Show(theHwnd)
return controls
)
--maxFormBuilderFunc()
标签:control show window box ati end click controls button
原文地址:https://www.cnblogs.com/trykle/p/11974131.html