当前位置: 开源爱好者 » Delphi源码 » UI界面 » 详情页

Delphi操作InputBoxSetPasswordChar变成密码框示例源码

对InputBoxSetPasswordChar操作:
  procedure TForm1.InputBoxSetPasswordChar(var Msg: TMessage);
  var
   hInputForm, hEdit: HWND;
  begin
   hInputForm := Screen.Forms[0].Handle;
   if (hInputForm <> 0) then
   begin
   hEdit := FindWindowEx(hInputForm, 0, 'TEdit', nil);
   SendMessage(hEdit, EM_SETPASSWORDCHAR, Ord('*'), 0);
   end;
  end;
  
  procedure TForm1.Button1Click(Sender: TObject);
  var
   InputString: string;
  begin
   PostMessage(Handle, InputBoxMessage, 0, 0);
   InputString := InputBox('密码', '请输入相关密码:', '');
   Edit1.Text := InputString;
  end;

Delphi操作InputBoxSetPasswordChar变成密码框示例源码测试效果图
源码包大小:5.76K
该源码已累计下载了:

CopyRight 2018© 开源爱好者 All Rights Reserved 豫ICP备16030607号 隐私声明 网站地图