Delphi :InputQuery,InputBox用法及区别
function InputQuery(const ACaption, APrompt: string; var Value: string): Boolean; procedure TForm1.Button1Click(Sender: TObject);
procedure TForm1.Button2Click(Sender: TObject); Delphi通过自定义消息自定义Inputbox,使其支持掩码并修改按钮的caption
首先自定义一个消息ID const 接着声明并实现该消息的处理过程 procedure InputBoxSetPasswordChar(var Msg: TMessage); message InputBoxMessage;//声明 procedure Tfrm.InputBoxSetPasswordChar(var Msg: TMessage);//实现
使用自定义后的InputBox PostMessage(Handle, InputBoxMessage, 0, 0); |
|