Pass *****

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Pass *****

Post by koleviko » Sun Oct 31, 2010 4:50 pm

Code: Select all

Dialog>Dialog1
   Caption=Dialog1
   Width=296
   Height=164
   Top=206
   Left=222
   Edit=msEdit1,15,24,121,Monika
   Edit=msEdit2,16,71,121,*******
   Label=Input name:,16,8,true
   Label=Input  password,16,56,true
   Button=Login,194,95,75,25,0
EndDialog>Dialog1


show>Dialog1,

How to password to look at stars ????

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sun Oct 31, 2010 8:10 pm

Hi koleviko,

I searched the forums for "password AND dialog" and found 60 matches.
in this post: [url]http://www.mjtnet.com/usergroup/viewtopic.php?t=5490[/url] Bob Hansen wrote:Here is the syntax for an Edit Box in the Dialog:
Name,Left,Top,Width,Preset-Text[,PasswordChar]

So,just add the optional,desired character after the default value, like this:
Edit=msEdit1,104,8,121,Fred,*
Here's your example modified to work (pre-v12 dialog):

Code: Select all

Dialog>Dialog1
   Caption=Dialog1
   Width=296
   Height=164
   Top=206
   Left=222
   Edit=msEdit1,15,24,121,Monika
   Edit=msEdit2,16,71,121,,*
   Label=Input name:,16,8,true
   Label=Input  password,16,56,true
   Button=Login,194,95,75,25,0
EndDialog>Dialog1

Show>Dialog1,Result
And here's how you might do it with a v12 dialog:

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 247
  Top = 96
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Dialog1'
  ClientHeight = 126
  ClientWidth = 280
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object msLabel1: TLabel
    Left = 16
    Top = 8
    Width = 56
    Height = 13
    Caption = 'Input name:'
    Transparent = True
  end
  object msLabel2: TLabel
    Left = 16
    Top = 56
    Width = 75
    Height = 13
    Caption = 'Input  password'
    Transparent = True
  end
  object msEdit1: TEdit
    Left = 15
    Top = 24
    Width = 121
    Height = 21
    TabOrder = 0
    Text = 'Monika'
  end
  object msEdit2: TEdit
    Left = 16
    Top = 71
    Width = 121
    Height = 21
    PasswordChar = '*'
    TabOrder = 1
    Text = ''
  end
  object msButton1: tMSButton
    Left = 194
    Top = 95
    Width = 75
    Height = 25
    Caption = 'Login'
    DoubleBuffered = True
    ParentDoubleBuffered = False
    ParentShowHint = False
    ShowHint = False
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
end
EndDialog>Dialog1

show>Dialog1,Result
Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Sun Oct 31, 2010 8:32 pm

jpuziano

Thank you very much !!!

:D

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts