判断一下密码框是否为空,最好把你的代码贴出来

解决方案 »

  1.   

    密码不输,直接点ok和不输密码点击cancel,inputbox都是返回inputbox的第三个参数ADefault,一般是emptystr(空字符串)的,你的警告框是根据密码是否正确来给出的,那结果不就一样,要想知道有没有按cancel就用inputquery代替inputbox:
    function InputQuery(const ACaption, APrompt: string; var Value: string
    ): Boolean;要是cancel就返回false的
    delphi help的有关内容:
    function InputBox(const ACaption, APrompt, ADefault: string): string;DescriptionCall InputBox to bring up an input dialog box ready for the user to enter a string in its edit box. ACaption is the caption of the dialog box.APrompt is the text that prompts the user to enter input in the edit box.ADefault is the string that appears in the edit box when the dialog box first appears.If the user chooses the Cancel button, InputBox returns the default string. If the user chooses the OK button, InputBox returns the string in the edit box.Use the InputBox function when there is a default value that should be used when the user chooses the Cancel button (or presses Esc) to exit the dialog. If the application needs to know whether the user chooses OK or Cancel, use the InputQuery function instead.