Jump to content

Recommended Posts

Posted

Доброе время суток! Подскажите пожалуйста как сделать у uniComboBox маскировку вводимых символов, как у uniEdit свойство PasswordChar. Тестовый проект ComboBoxPass.zip

screen_1.jpg.432d2e939f5000f7f813ce5c3f95d7de.jpg

Posted

Добрый день,

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniComboBox1.JSInterface.JSConfig('inputType', ['password']);
end;

?

Posted
3 minutes ago, Sherzod said:

Добрый день,


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniComboBox1.JSInterface.JSConfig('inputType', ['password']);
end;

?

попробую

Posted
35 minutes ago, Sherzod said:

Добрый день,


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniComboBox1.JSInterface.JSConfig('inputType', ['password']);
end;

?

спасибо, работает. Возможно ли менять значение на UniComboBox1.JSInterface.JSConfig('inputType', ['text']) по событию UniComboBox1TriggerEvent?

Posted
3 minutes ago, =GGG= said:

Возможно ли менять значение на UniComboBox1.JSInterface.JSConfig('inputType', ['text']) по событию UniComboBox1TriggerEvent?

Пожалуйста, можете уточнить?

Posted
8 minutes ago, Sherzod said:

Пожалуйста, можете уточнить?

чтобы по нажатию на кнопку с иконкой пароль отображался и скрывался
        ShowPsw := not ShowPsw;
        if ShowPsw then
            edPassword.PasswordChar:=#0
        else
            edPassword.PasswordChar:='*';

Posted
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;

Может как-то так...

Posted

Пробовал
if AButtonId = 0 then
    begin
        ShowPsw := not ShowPsw;
        if ShowPsw then
            edPassword.JSInterface.JSConfig('inputType', ['text'])
        else
            edPassword.JSInterface.JSConfig('inputType', ['password']);
    end;

 

выдает ошибку

screen_2.jpg

Posted
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;

Может как-то так...

спасибо!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...