FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Hide a Checkbox from Resource.
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 05:28 PM

Is there a trick to hide a checkbox on a dialog which I access through an RC file. I am making a calendar routine and wanted to hide all days outside of the current month, I can disable them so the user cannot check them, but I wanted to make them disappear. Thanks,

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 05:52 PM

oChkBox:Hide()

Regards



G. N. Rao.

Hyderabad, India
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 06:02 PM

That was my first guess but this does not seem to work.

For dDay := dStart to dEnd

    nEle++

    nId++

    lVar := FALSE

    oChk := nil



    If dDay >= dFrom .AND. dDay <= dTo

            Redefine CheckBox oChk Var lVar Id nId of oDlg

            oChk:SetText( PadL( Day(dDay),2,"0" ) )

        oChk:cargo := dDay

        oChk:SetCheck( FALSE )

    Else

        Redefine CheckBox oChk Var lVar Id nId of oDlg

        oChk:Hide()

   Endif

Next
Thanks,

Byron Hopp

Matrix Computer Services
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 06:13 PM

It appears that I need to perform this after the activate of the dialog. Works great. Thanks,

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 06:13 PM

STATIC oChk ??

Regards.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 06:19 PM

I hide them using the "ON INIT" when activating the dialog. Seemed to work well.

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 06:24 PM
Maybe:
Code (fw): Select all Collapse
   REDEFINE CHECKBOX OCHK VAR LVAR ID NID OF ODLG // WHEN(.. )

   IF DDAY >= DFROM .AND. DDAY <= DTO

      ACTIVATE DIALOG ODLG CENTER // NORMAL

   ELSE

       ACTIVATE DIALOG ODLG CENTER ON INIT( OCHK:HIDE() )

   ENDIF
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Hide a Checkbox from Resource.
Posted: Mon Jul 03, 2023 07:29 PM
byron.hopp wrote:It appears that I need to perform this after the activate of the dialog. Works great. Thanks,
Yes.
We need to remember this always in case of all controls created on a dialog.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion