InputBox弹出窗口有两个按钮,一个为OK,一个为Cancel,请问如果点击Cancel,则其返回值是什么,谢谢!

解决方案 »

  1.   

    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.
      

  2.   

    你改用Inputquery就可以接收是那个按钮了
      

  3.   

    点确定返回的是你填写的内容,string类型
    或者是返回空字符串
      

  4.   

    inputbox('a','b','')
    确定为你输入的值,取消返回空
    inputbox('a','b','c')
    确定为你输入的值,取消返'c'