Subject Re: onlostfocus with a combobox
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Wed, 26 Aug 2015 11:50:29 -0700
Newsgroups dbase.getting-started

On 8/26/2015 11:31 AM, Rich K wrote:
> hello again,
> Here is the code snippet that is giving me trouble with the onlostfocus command with a combobox.
> Please let me know what i am missing, the two lines i have tried to use are commented out.
> Code follows
> =====
> //category lock  box
>
> this.catlock = new COMBOBOX(this)
>     with (this.catlock)
> height = 19
>        left = 20
>        top = 1
>        width = 15
>        fontSize = 9
>        dataSource = "array catarray"
> style = 2        // DropDownList
>        dropDownHeight = 132
> autodrop = true
> //onlostfocus = class::btest
> //onchange = class::btest
> endwith
>

I just tried this, and it works perfectly (and I tried changing the
style to 2, and it still worked fine):

** END HEADER -- do not remove this line
//
// Generated on 08/26/2015
//
parameter bModal
local f
f = new ComboboxTestForm()
if (bModal)
    f.mdi = false // ensure not MDI
    f.readModal()
else
    f.open()
endif

class ComboboxTestForm of FORM
    with (this)
       metric = 6        // Pixels
       height = 198.0
       left = 213.0
       top = 60.0
       width = 407.0
       text = ""
    endwith

    this.COMBOBOX1 = new COMBOBOX(this)
    with (this.COMBOBOX1)
       onLostFocus = class::COMBOBOX1_ONLOSTFOCUS
       onChange = class::COMBOBOX1_ONCHANGE
       height = 22.0
       left = 32.0
       top = 40.0
       width = 226.0
       dataSource = 'array {"SomeData","MoreData","Test","Test2"}'
       style = 1        // DropDown
       dropDownHeight = 132.0
    endwith

    this.PUSHBUTTON1 = new PUSHBUTTON(this)
    with (this.PUSHBUTTON1)
       onClick = class::PUSHBUTTON1_ONCLICK
       height = 24.0
       left = 91.0
       top = 119.0
       width = 107.0
       text = "Close form"
    endwith

    function COMBOBOX1_onChange()
       ? "onChange has fired"
    return

    function COMBOBOX1_onLostFocus()
       ? "OnLostFocus has fired"
    return

    function PUSHBUTTON1_onClick()
       form.close()
    return

endclass




--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#dUFLP
dBASE Books: http://www.goldenstag.net/dbase/dBASEBooks.htm