Subject Subform canClose
From Peter Hegelbach <peter@hegelbach.com>
Date Mon, 8 Mar 2021 07:40:15 +0100
Newsgroups dbase.getting-started

Hi

I would like to prevent the Subform from closing. But the mainform
should close. It seems that subform.canClose is effectiv for both forms.

Bug or not?

Peter



** END HEADER -- Diese Zeile nicht entfernen
//
// Erstellt am 08.03.2021
//
parameter bModal
local f
f = new neuForm()
if (bModal)
    f.mdi = false // Nicht-MDI festlegen
    f.ReadModal()
else
    f.Open()
endif

class neuForm of FORM
    with (this)
                onOpen = class::form_onOpen
                canClose = class::form_canClose
                metric = 6
       height = 250
       left = 100
       top = 80
       width = 600
       text = "Testform"
    endwith
        
        this.SubF = new subform(this)
        with (this.SubF)
                canClose = {||false}
                colorNormal = "Moccasin"
                metric = 6
                borderStyle = 4
                left = 600
                top = 60
                width = 400
                height = 230
                text = "Daten bearbeiten"
                visible = true
                sizeable = false
                moveable = false
                systemTheme = false
                maximize = false
                minimize = false
                escExit = false
                smallTitle = true
        endwith

        function form_onOpen
                form.SubF.open()
                return
                
        function form_canClose
                // do my things
                form.close()
                return

endclass