Silvio, el modelo del Maestro Nages, con pocos cambios, funciona perfectamente en Windows 7 32 bits con HARBOUR y XHARBOUR. Pruébelo en Windows 10/11
- Code: Select all Expand view RUN
// C:\FWH\SAMPLES\NAGESMAI.PRG
#include "FiveWin.ch"
#include "HbCompat.ch"
STATIC preCompiled
FUNCTION SilviBtnBmp()
LOCAL oDlg, oGet, oBtn, oFont, oSalida, oSay, cSay, cTitle, oIco
LOCAL cEmail := Space( 40 )
SetGetColorFocus()
cSay := "INGRESE UN CORREO VÁLIDO:"
cTitle := "FIVEWIN: VALIDAR EMAIL BY SILVIO FALCONI ->" + Version()
DEFINE ICON oIco FILE "..\icons\sendmail.ico"
DEFINE FONT oFont NAME "Segoe UI" SIZE 0, - 24
DEFINE DIALOG oDlg SIZE 600, 300 PIXEL TRUEPIXEL TITLE cTitle FONT oFont ;
TRANSPARENT ICON oIco
oDlg:lHelpIcon := .F.
// Silvio: Intente ahora con Windows 10/11 En Windows 7 funciona bien.
@ 38, 40 GET oSay VAR cSay SIZE 400, 40 PIXEL PICTURE "@K!" OF oDlg ;
FONT oFont UPDATE COLOR CLR_WHITE, CLR_BLACK NOBORDER WHEN( .F. )
oSay:lBtnTransparent := .T. // transparent button get oSay
oSay:lAdjustBtn := .T. // Button Get Adjust Witdh oSay
oSay:lDisColors := .F. // Deactive disable color
oSay:nClrTextDis := CLR_WHITE // Color text disable status
oSay:nClrPaneDis := CLR_BLACK // Color Pane disable status
@ 80, 40 GET oGet VAR cEmail SIZE 400, 40 PIXEL OF oDlg ;
ON CHANGE ( oDlg:AEvalWhen(), oDlg:Update() )
@ 200, 40 BTNBMP oBtn PROMPT "Account Invio" LEFT ;
FILE "..\bitmaps\alphabmp\gmail.bmp", "", ;
"..\bitmaps\alphabmp\question.bmp", "" ;
SIZE 220, 60 PIXEL OF oDlg FLAT ;
ACTION MsgInfo( LOWER( cEmail ) ) ;
WHEN ValidaEmail( cEmail )
@ 200, 350 BTNBMP oSalida PROMPT "Salida" LEFT FONT oFont ;
FILE "..\bitmaps\Exit.bmp" SIZE 220, 60 PIXEL OF oDlg FLAT 2007 GDIP ;
COLOR CLR_WHITE, CLR_BLACK ACTION( oDlg:End() )
oSalida:cToolTip := "Salida - Exit - Cancelar"
oSalida:bClrGrad := { |lInvert| If( lInvert, 0x60FFA54A, nARGB( 64, 0, 192, 0 ) ) }
WITH OBJECT oSalida
:nClrBorder := { |lInvert| If( lInvert, 0x80FFA54A, nARGB( 54, 0, 192, 0 ) ) } // CLR_BLACK // border color
:bColorMap := { || { { CLR_YELLOW, CLR_BLACK } } } // image color
END
oSalida:lCancel := .T.
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
RETURN NIL
FUNCTION ValidaEmail( cEmail )
DEFAULT preCompiled := hb_regexComp( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" )
RETURN .NOT. EMPTY( hb_regex( preCompiled, AllTrim( cEmail ) ) )
// FIN / END
Regards, saludos.