Saludos foro,
Como puedo ocultar el Boton [X] en un dialogo?
Gracias de antemano
PROCEDURE DisableX( oDlg, lDisable )
LOCAL hMenu := 0
LOCAL nCount := 0
DEFAULT lDisable := TRUE
IF lDisable
hMenu := GetSystemMenu( oDlg:hWnd, FALSE )
nCount := GetMItemCount( hMenu )
IF oDlg:ClassName() = "TDIALOG"
RemoveMenu( hMenu, 1, nOR( 1024, 2) )
ELSE
RemoveMenu( hMenu, nCount - 1, nOR( 1024, 2 ) )
RemoveMenu( hMenu, nCount - 2, nOR( 1024, 2 ) )
ENDIF
DrawMenuBar( oDlg:hWnd )
ELSE
GetSystemMenu( oDlg:hWnd, TRUE )
DrawMenuBar( oDlg:hWnd )
ENDIF
RETURN
STYLE nOr( DS_SYSMODAL, DS_MODALFRAME )
WS_POPUP
WS_CAPTION
WS_SYSMENU
WS_3DLOOK
WS_VISIBLE
WS_THICKFRAME
WS_VISIBLE
WS_OVERLAPPEDWINDOW )
Compuin wrote:Hola Jose Vicente,
Gracias por tu respuesta.
En mi caso no uso recursos para los Dialogos.
Como lo resuelvo?
DEFINE DIALOG oDlg SIZE nWd,nHt PIXEL TITLE "LIGAS PARA LICORES" ;
STYLE (WS_POPUP|WS_VISIBLE)
DEFINE DIALOG oDlg SIZE nWd,nHt PIXEL TITLE "LIGAS PARA LICORES" ;
STYLE (WS_POPUP|WS_VISIBLE|WS_CAPTION)
karinha wrote:Teste:
- Code: Select all Expand view RUN
STYLE nOr( DS_SYSMODAL, DS_MODALFRAME )
WS_POPUP
WS_CAPTION
WS_SYSMENU
WS_3DLOOK
WS_VISIBLE
WS_THICKFRAME
WS_VISIBLE
WS_OVERLAPPEDWINDOW )
// \SAMPLES\DISABLEX.PRG - Example, By: Carlos Vargas. In xHarbour, perfect.
#Include "FiveWin.ch"
#Define TRUE .T.
#Define FALSE .F.
FUNCTION Main()
LOCAL lDisable AS LOGICAL
LOCAL oDlg AS OBJECT
LOCAL oIco AS OBJECT
LOCAL cTest := "Hello world! "
lDisable := TRUE
DEFINE ICON oIco FILE "..\icons\fivewin.ico"
DEFINE DIALOG oDlg TITLE "DialogBox and DisableX" COLOR "W+/B" ;
ICON oIco
@ 1, 3 GET cTest DIALOG oDlg
@ 3, 5 BUTTON "&Ok" DIALOG oDlg SIZE 40, 12 ;
ACTION MsgInfo( "Any action here!" ) DEFAULT
@ 3, 16 BUTTON "&Cancel" DIALOG oDlg SIZE 40, 12 ACTION( oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT( DisableX( oDlg, lDisable ) )
RETURN NIL
PROCEDURE DisableX( oDlg, lDisable )
LOCAL hMenu := 0
LOCAL nCount := 0
DEFAULT lDisable := TRUE
IF lDisable
hMenu := GetSystemMenu( oDlg:hWnd, FALSE )
nCount := GetMItemCount( hMenu )
IF oDlg:ClassName() = "TDIALOG"
RemoveMenu( hMenu, 1, nOR( 1024, 2) )
ELSE
RemoveMenu( hMenu, nCount - 1, nOR( 1024, 2 ) )
RemoveMenu( hMenu, nCount - 2, nOR( 1024, 2 ) )
ENDIF
DrawMenuBar( oDlg:hWnd )
ELSE
GetSystemMenu( oDlg:hWnd, TRUE )
DrawMenuBar( oDlg:hWnd )
ENDIF
RETURN
// FIN - 16/03/2021 - Covid-19 - kapiabafwh@gmail.com
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 70 guests