Page 1 of 2
Textbox Password Property ...
Posted: Thu Nov 27, 2014 2:43 am
by hmgchang
Dear Masters,
The Password property of the TextBox control can be set as .T. or .F. when we defined/designed...
But i get an error saying syntax error while tried to change :
Main.txtPass.Password := .T.
or are there any other ways to alter the property ?
TIA
best rgds,
Chang
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 4:20 am
by andyglezl
No entiendo el porque quieres alterar esta propiedad, o es Texbox "normal" ó para "Password".
Creo que solo lo puedes hacer al momento de la definición.
En la lista de propiedades no aparece esta propiedad.
---------------------------------------------------------------------------------------------------------------
I do not understand why you want to alter this property or is "normal" or to "Password" TexBox.
I think you can only do when the definition.
In the list of properties this property does not appear.
Code: Select all
DEFINE TEXTBOX <Controlname>
........
PASSWORD <lValue>
........
END TEXTBOX
Properties:
- Value
- Enabled
- Visible
- Row
- Col
- Width
- Height
- FontName
- FontSize
- FontBold
- FontItalic
- FontUnderline
- FontStrikeout
- ToolTip
- BackColor
- FontColor
- DisabledBackColor
- DisabledFontColor
- CaretPos
- ReadOnly
- Name (R)
- TabStop (D)
- Field (D)
- Parent (D)
- InputMask (D)
- Format (D)
- MaxLength (D)
- RightAlign (D)
- HelpId (D)
- CaseConvert (D)
- DataType (D)
D: Available at control definition only
R: Read-Only
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 6:19 am
by hmgchang
Thks for your info, but...

- passwordproperty.JPG (10.4 KiB) Viewed 7162 times
so... if the checkbox is checked...
then i need to display the password entered at the textbox...
my idea is to just set the password property to .F.
and when the checkbox is unchecked... then
Main.txtPass.Password := .T.
but it wont compile.....
pls advise n TIA
best rgds
Chang
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 8:31 am
by serge_girard
Chang,
I believe it has been hardcoded in order to avoid to see passwords.
Serge
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 8:33 am
by mol
Against creating checkbox Show password and display eneted password in Password field, you can create something like in widows 8 - picture with eye, when you go to this picture, the password will show in balloon.
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 10:15 am
by gfilatov
hmgchang wrote:...
then i need to display the password entered at the textbox...
my idea is to just set the password property to .F.
and when the checkbox is unchecked... then
Main.txtPass.Password := .T.
Hi Chang,
Please be so kind to review the following simple sample:
Code: Select all
/*
* MINIGUI - Harbour Win32 GUI library Demo
*
*/
#include "minigui.ch"
FUNCTION Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 300 ;
TITLE "MiniGUI Password Demo" ;
MAIN ;
FONT "Arial" SIZE 10
MakePasswordControl( 'Secret', .T. )
@ 40,10 CHECKBOX Check_1 CAPTION 'Show password' ;
VALUE .F. ;
WIDTH 120 ;
TOOLTIP 'CheckBox Control' ;
ON CHANGE MakePasswordControl( Form_1.Text_pass.Value, ! Form_1.Check_1.Value )
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
RETURN Nil
FUNCTION MakePasswordControl( cPass, lShow )
IF IsControlDefined (Text_pass, Form_1) == .T.
Form_1.Text_pass.Release
ENDIF
DEFINE TEXTBOX Text_pass
PARENT Form_1
ROW 10
COL 10
VALUE cPass
PASSWORD lShow
FONTNAME "Arial"
FONTSIZE 10
TOOLTIP 'Password TextBox'
MAXLENGTH 16
END TEXTBOX
RETURN lShow
Hope that useful

Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 3:41 pm
by PeteWG
Hi Chang,
as already stated, PASSWORD property isn't available/changeable at runtime.
However you can achieve what you're looking for with various tricks like this one posted by Grigory.
below is an other approach which you might consider.
Code: Select all
#include "minigui.ch"
FUNCTION Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 120 ;
TITLE "Show/hide Password" ;
MAIN ;
FONT "Arial" SIZE 10
DEFINE TEXTBOX Pass_Shown
PARENT Form_1
ROW 30
COL 70
VALUE ""
FONTNAME "Arial"
FONTSIZE 10
MAXLENGTH 16
INVISIBLE .T.
END TEXTBOX
DEFINE TEXTBOX Pass_Hidden
PARENT Form_1
ROW 30
COL 70
VALUE ""
PASSWORD .T.
FONTNAME "Arial"
FONTSIZE 10
TOOLTIP 'Password TextBox'
MAXLENGTH 16
END TEXTBOX
@ 33,200 CHECKBOX Check_1 CAPTION 'Show password' ;
VALUE .F. ;
WIDTH 120 ;
TOOLTIP 'CheckBox Control' ;
ON CHANGE ShowPassWord( This.Value )
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
RETURN Nil
PROCEDURE ShowPassWord( lShow )
IF lShow
Form_1.Pass_Shown.Value := Form_1.Pass_Hidden.Value
DoMethod( 'Form_1', 'Pass_Hidden', 'Hide' )
DoMethod( 'Form_1', 'Pass_Shown', 'Show' )
ELSE
Form_1.Pass_Hidden.Value := Form_1.Pass_Shown.Value
DoMethod( 'Form_1', 'Pass_Hidden', 'Show' )
DoMethod( 'Form_1', 'Pass_Shown', 'Hide' )
ENDIF
RETURN
rgrds,
Pete
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 5:25 pm
by Javier Tovar
Hola PeteGW,
Existe la propiedad:
INVISIBLE .T. en HMG? que versión usas?
Saludos
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 5:58 pm
by Javier Tovar
Hola Chang,
Yo lo hago así:
Code: Select all
/*
* MINIGUI - Harbour Win32 GUI library Demo
*
*/
#include "minigui.ch"
FUNCTION Main
LOCAL cPass := "Secret"
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 300 ;
TITLE "MiniGUI Password Demo" ;
MAIN ;
FONT "Arial" SIZE 10
DEFINE TEXTBOX Text_pass
PARENT Form_1
ROW 10
COL 10
VALUE cPass
PASSWORD .T.
FONTNAME "Arial"
FONTSIZE 10
TOOLTIP 'Password TextBox'
MAXLENGTH 16
END TEXTBOX
DEFINE TEXTBOX Text_NoPass
PARENT Form_1
ROW 10
COL 10
VALUE cPass
PASSWORD .F.
FONTNAME "Arial"
FONTSIZE 10
TOOLTIP 'Password TextBox'
MAXLENGTH 16
END TEXTBOX
@ 40,10 CHECKBOX Check_1 CAPTION 'Show password' ;
VALUE .F. ;
WIDTH 120 ;
TOOLTIP 'CheckBox Control' ;
ON CHANGE Cambia(This.Value)
END WINDOW
Form_1.Text_NoPass.Hide
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
RETURN Nil
FUNCTION Cambia(lValue)
IF lValue == .F.
Form_1.Text_NoPass.Hide
Form_1.Text_pass.Show
ELSE
Form_1.Text_pass.Hide
Form_1.Text_NoPass.Show
ENDIF
RETURN
Saludos
Re: Textbox Password Property ...
Posted: Thu Nov 27, 2014 7:27 pm
by PeteWG
Javier Tovar wrote:Hola PeteGW,
Existe la propiedad:
INVISIBLE .T. en HMG? que versión usas?
Saludos
Hi Havier
INVISIBLE property last time i looked at 3.3.1. docs, was there. You mean it doesn't work? ( I didn't test with HMG, though)
I do use both HMG & Mingui extended.
PS. btw, your sample you posted needs some edit. check it and i'm sure you'll find what i mean.

rgrds,
Pete