CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Delphi >  VCL组件开发及应用

input box问题!

楼主yangpeng106(小牛)2002-09-18 20:54:27 在 Delphi / VCL组件开发及应用 提问

怎样能使input   box输入框中的输入以*****显示? 问题点数:20、回复次数:7Top

1 楼chechy(www.qdocuments.net)回复于 2002-09-18 20:55:44 得分 0

将PasswordChar设为*Top

2 楼yangpeng106(小牛)回复于 2002-09-18 21:00:39 得分 0

同志,我是在使用input   box函数!怎么设啊?Top

3 楼blazingfire(烈焰)(对.net极度憎恨中....)回复于 2002-09-18 21:03:25 得分 0

没办法。只有自己作一个窗体再放几个控件了。Top

4 楼yangpeng106(小牛)回复于 2002-09-18 21:04:43 得分 0

哦?  
   
  真的没有再方便一点的做法么?Top

5 楼Kingron(单身走我路……)回复于 2002-09-18 21:22:08 得分 20

我们经常使用InputBox,但是,一个缺点就是,Inputbox不能有密码掩码的功能,就是用*掩盖输入的字符,下面的代码演示了一个巧妙的方法来做到这一点:  
  const  
      InputBoxMessage   =   WM_USER   +   200;  
   
  type  
      TForm1   =   class(TForm)  
          Button1:   TButton;  
          procedure   Button1Click(Sender:   TObject);  
      private  
          procedure   InputBoxSetPasswordChar(var   Msg:   TMessage);   message   InputBoxMessage;  
      public  
      end;  
   
  var    
      Form1:   TForm1;    
   
  implementation    
   
  {$R   *.DFM}    
   
  procedure   TForm1.InputBoxSetPasswordChar(var   Msg:   TMessage);    
  var    
      hInputForm,   hEdit,   hButton:   HWND;    
  begin    
      hInputForm   :=   Screen.Forms[0].Handle;    
      if   (hInputForm   <>   0)   then    
      begin    
          hEdit   :=   FindWindowEx(hInputForm,   0,   'TEdit',   nil);    
          {    
              //   Change   button   text:    
              hButton   :=   FindWindowEx(hInputForm,   0,   'TButton',   nil);    
              SendMessage(hButton,   WM_SETTEXT,   0,   Integer(PChar('Cancel')));    
          }  
          SendMessage(hEdit,   EM_SETPASSWORDCHAR,   Ord('*'),   0);    
      end;    
  end;    
   
  procedure   TForm1.Button1Click(Sender:   TObject);    
  var    
      InputString:   string;    
  begin    
      PostMessage(Handle,   InputBoxMessage,   0,   0);  
      InputString   :=   InputBox('Input   Box',   'Please   Enter   a   Password',   '');  
  end;Top

6 楼blazingfire(烈焰)(对.net极度憎恨中....)回复于 2002-09-18 21:42:38 得分 0

~~~~~~~~~~五体投地~~~~~~~~~~Kingron神呀!!!!Top

7 楼blazingfire(烈焰)(对.net极度憎恨中....)回复于 2002-09-18 21:43:30 得分 0

强烈建议版主加入精华区!Top

相关问题

  • INPUT BOX里怎麼樣才能動態知道該內容已經變更?
  • INPUT BOX里怎麼樣才能動態知道該內容已經變更?
  • 如何取出包含双引号的字符专递到javascript的input box!!
  • Direct Input疑问
  • input iterator requirements
  • how to input chinese?
  • <input type=button ....>?????????????
  • how to input chinese in linux
  • 关于input, button
  • input的定位

关键词

  • hinputform
  • inputboxmessage
  • hedit
  • hbutton
  • inputbox
  • tform
  • input box
  • 输入
  • procedure
  • button

得分解答快速导航

  • 帖主:yangpeng106
  • Kingron

相关链接

  • Delphi类图书
  • Delphi类源码下载
  • Delphi控件下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo