Hide a Checkbox from Resource.

Hide a Checkbox from Resource.

Postby byron.hopp » Mon Jul 03, 2023 5: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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Hide a Checkbox from Resource.

Postby nageswaragunupudi » Mon Jul 03, 2023 5:52 pm

oChkBox:Hide()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Hide a Checkbox from Resource.

Postby byron.hopp » Mon Jul 03, 2023 6: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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Hide a Checkbox from Resource.

Postby byron.hopp » Mon Jul 03, 2023 6: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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Hide a Checkbox from Resource.

Postby karinha » Mon Jul 03, 2023 6:13 pm

STATIC oChk ??

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Hide a Checkbox from Resource.

Postby byron.hopp » Mon Jul 03, 2023 6:19 pm

I hide them using the "ON INIT" when activating the dialog. Seemed to work well.
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Hide a Checkbox from Resource.

Postby karinha » Mon Jul 03, 2023 6:24 pm

Maybe:

Code: Select all  Expand view  RUN

   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
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Hide a Checkbox from Resource.

Postby nageswaragunupudi » Mon Jul 03, 2023 7: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
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 25 guests