type QDialog1 extends QForm
    Container1 as QButton
   public:
   declare operator cast as any ptr
   declare static sub Container1onClick(byref as QObject)
   declare constructor
end type

dim shared Dialog1 as QDialog1
application.run

operator QDialog1.cast as any ptr
    return @this
end operator

constructor QDialog1
    qform.register
    qbutton.register
    #include once "C:\Users\nasta\OneDrive\Desktop\Dialog1.bfm"
end constructor

sub QDialog1.Container1onClick(sender as QObject)
    showmessage "click"
end sub