Subject Re: CUSTOM CONTROLS
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Sat, 20 Jan 2018 12:22:52 -0800
Newsgroups dbase.getting-started

On 1/20/2018 10:48 AM, Mustansir Ghor wrote:
> Dear Mervyn
>
> Yes. It does work. Thanks. But the problem comes when a custom control is container class with other controls in it. The container retains its position but all control inside the container disappear.
>

What you can do, although it's a real pain, is:

set up the form with one metric when designing the control(s), then note
the information about top, left, width, height -- write it down. Change
the metric to the second form metric, and do the same (write the
specifics down).

Then, in the container's onDesignOpen event handler, add code that
check's the form's metric:

     if form.metric == 6 // pixels
        this.top := some value
        this.left := some value
        this.height := some value
        this.width := some value
        this.MyEntryfield1.top := some value
        // and so on
    else // form.metric == 0 for chars
        this.top := some value
        this.left := some value
        this.height := some value
        this.width := some value
        this.MyEntryfield1.top := some value
        // and so on
    endif

What this should do is allow for dropping the control(s) onto a form
with the a different metric ...

Ken


--
*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/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm