check if a control is hidden or not

check if a control is hidden or not

Postby ellano » Mon Sep 24, 2018 8:15 am

Could someone please tell me how to detect a hidden control?

I've tried:

Code: Select all  Expand view
REDEFINE BUTTONBMP ID 505 OF oFld:aDialogs[3] ;   //show images
         ACTION ( msgstop( GetNMHDRHWndFrom( oBmp[3]:oDlg ) ), ;
         Show_Hide_Img(.F., .T., oDbf, oDlg, @oBmp, @cText, aPedg, cImages) );
         BITMAP ".\images\camera.bmp"
REDEFINE IMAGE oBmp[3]   ID 400 OF oFld:aDialogs[3] ADJUST UPDATE

msgstop( IsWindowVisible( oBmp[3]:oDlg ) )
msgstop( IsWindowVisible( ::oBmp[3]:oDlg ) )
msgstop( IsWindowVisible( oBmp[3]:oDlg:hWnd ) )
msgstop( IsWindowVisible( ::oBmp[3]:oDlg:hWnd ) )

msgstop( IsWindowVisible( oDlg:hWnd ) )  //<-- this works but I do not need to know if the dialog is hidden, but if the control oBmp [3] of the dialog oDlg has been hidden


I get "Error BASE/1004 Message not found: TIMAGE:ODLG"
ellano
 
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

Re: check if a control is hidden or not

Postby ellano » Mon Sep 24, 2018 8:39 am

Since this was urgent I solve it like this:

Code: Select all  Expand view
LOCAL lHide:=.F.
...
REDEFINE BUTTONBMP ID 505 OF oFld:aDialogs[3] ;   //show images
         ACTION ( lHide:= !lHide, ;
         Show_Hide_Img(lHide, .T., oDbf, oDlg, @oBmp, @cText, aPedg, cImages) );
         BITMAP ".\images\camera.bmp"
REDEFINE IMAGE oBmp[3]   ID 400 OF oFld:aDialogs[3] ADJUST UPDATE
...
 


But it will be nice to know the "right" way

Thanks
Emiliano Llano Díaz
ellano
 
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

Re: check if a control is hidden or not

Postby Enrico Maria Giordano » Mon Sep 24, 2018 12:15 pm

Code: Select all  Expand view
msgstop( IsWindowVisible( oBmp[3]:hWnd ) )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8515
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: check if a control is hidden or not

Postby ellano » Tue Sep 25, 2018 6:11 am

The only variation I did not try!

:oops:

Thanks

ELLD

Code: Select all  Expand view
REDEFINE BUTTONBMP ID 505 OF oFld:aDialogs[3] ;   //Show photo
         ACTION Hide_Image( IsWindowVisible(oBmp[3]:hWnd), .T., oDbf, oDlg, @oBmp, @cText, aPedg, cImage) ;
         BITMAP ".\images\camera.bmp"
REDEFINE IMAGE oBmp[3]   ID 400 OF oFld:aDialogs[3] ADJUST UPDATE
ellano
 
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests