MSMK Posted April 1, 2019 Share Posted April 1, 2019 Доброе время суток! Подскажите пожалуйста как сделать у uniComboBox маскировку вводимых символов, как у uniEdit свойство PasswordChar. Тестовый проект ComboBoxPass.zip Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2019 Share Posted April 1, 2019 Добрый день, procedure TMainForm.UniFormCreate(Sender: TObject); begin UniComboBox1.JSInterface.JSConfig('inputType', ['password']); end; ? Link to comment Share on other sites More sharing options...
MSMK Posted April 1, 2019 Author Share Posted April 1, 2019 3 minutes ago, Sherzod said: Добрый день, procedure TMainForm.UniFormCreate(Sender: TObject); begin UniComboBox1.JSInterface.JSConfig('inputType', ['password']); end; ? попробую Link to comment Share on other sites More sharing options...
MSMK Posted April 1, 2019 Author Share Posted April 1, 2019 35 minutes ago, Sherzod said: Добрый день, procedure TMainForm.UniFormCreate(Sender: TObject); begin UniComboBox1.JSInterface.JSConfig('inputType', ['password']); end; ? спасибо, работает. Возможно ли менять значение на UniComboBox1.JSInterface.JSConfig('inputType', ['text']) по событию UniComboBox1TriggerEvent? Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2019 Share Posted April 1, 2019 3 minutes ago, =GGG= said: Возможно ли менять значение на UniComboBox1.JSInterface.JSConfig('inputType', ['text']) по событию UniComboBox1TriggerEvent? Пожалуйста, можете уточнить? Link to comment Share on other sites More sharing options...
MSMK Posted April 1, 2019 Author Share Posted April 1, 2019 8 minutes ago, Sherzod said: Пожалуйста, можете уточнить? чтобы по нажатию на кнопку с иконкой пароль отображался и скрывался ShowPsw := not ShowPsw; if ShowPsw then edPassword.PasswordChar:=#0 else edPassword.PasswordChar:='*'; Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2019 Share Posted April 1, 2019 16 minutes ago, =GGG= said: чтобы по нажатию на кнопку с иконкой пароль отображался и скрывался private { Private declarations } FInputType: string; procedure TMainForm.UniComboBox1TriggerEvent(Sender: TUniCustomComboBox; AButtonId: Integer); begin if AButtonId = 0 then begin // Вам нужна переменная, которая будет хранить пред.значение if FInputType = 'password' then begin Sender.JSInterface.JSCall('inputEl.el.dom.setAttribute', ['type', 'text']); FInputType := 'text'; end else begin Sender.JSInterface.JSCall('inputEl.el.dom.setAttribute', ['type', 'password']); FInputType := 'password' end; end; end; procedure TMainForm.UniFormCreate(Sender: TObject); begin UniComboBox1.JSInterface.JSConfig('inputType', ['password']); FInputType := 'password' end; Может как-то так... Link to comment Share on other sites More sharing options...
MSMK Posted April 1, 2019 Author Share Posted April 1, 2019 Пробовал if AButtonId = 0 then begin ShowPsw := not ShowPsw; if ShowPsw then edPassword.JSInterface.JSConfig('inputType', ['text']) else edPassword.JSInterface.JSConfig('inputType', ['password']); end; выдает ошибку Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2019 Share Posted April 1, 2019 JSCall Link to comment Share on other sites More sharing options...
MSMK Posted April 1, 2019 Author Share Posted April 1, 2019 17 minutes ago, Sherzod said: private { Private declarations } FInputType: string; procedure TMainForm.UniComboBox1TriggerEvent(Sender: TUniCustomComboBox; AButtonId: Integer); begin if AButtonId = 0 then begin // Вам нужна переменная, которая будет хранить пред.значение if FInputType = 'password' then begin Sender.JSInterface.JSCall('inputEl.el.dom.setAttribute', ['type', 'text']); FInputType := 'text'; end else begin Sender.JSInterface.JSCall('inputEl.el.dom.setAttribute', ['type', 'password']); FInputType := 'password' end; end; end; procedure TMainForm.UniFormCreate(Sender: TObject); begin UniComboBox1.JSInterface.JSConfig('inputType', ['password']); FInputType := 'password' end; Может как-то так... спасибо! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now