Using Dialogs and setting the 'visible' property on controls

Using Dialogs and setting the 'visible' property on controls

If I have an edit box control (named IDC_NAME) in a dialog, is there any way to make the edit box appear and disapper during run-time? You know how you can make an edit box be enabled or disabled during run-time by doing something like this: lret = DlgSet (dlg, IDC_NAME, .FALSE., dlg_enable) to disable it and something like this to enable again:
lret = DlgSet (dlg, IDC_NAME, .TRUE.,dlg_enable). There is a 'visible' property you can check and uncheck, but how do you make it visible or invisible during run-time as with the enable/disable feature?

3 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

a) You can use ShowWindow(GetDlgItem(Dlg%hWnd, IDC_EDIT_X), SW_SHOW/SW_HIDE) APIs (USE DFWIN). That will work only from callback functions, though (not from the same routine you call DlgInit);

b) You can download my "tweaked" version of DFLOGM from my home page which, among other extensions, supports DLG_VISIBLE property for all controls.

Jugoslav

Jugoslav www.xeffort.com

!
! Sets the visible state of a control in a dialog box. Hidden
! controls (visible = false) are not drawn and cannot be used.
!
SUBROUTINE ControlSetVisible(hwnd, controlID, visible)
IMPLICIT NONE
INTEGER, INTENT(IN) :: hwnd
INTEGER, INTENT(IN) :: controlID
LOGICAL, INTENT(IN) :: visible

INTEGER :: rval
INTEGER :: hwndControl
INTEGER :: nCmdShow

hwndControl = GetDlgItem(hwnd, controlId)
IF(visible) THEN
nCmdShow = SW_SHOW
ELSE
nCmdShow = SW_HIDE
END IF

rval = ShowWindow (hwndControl, nCmdShow)

END SUBROUTINE ControlSetVisible

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi