VBA Password Input with Cancel Function

后端 未结 1 1885
鱼传尺愫
鱼传尺愫 2020-11-28 15:33

I have been using the standard password textbox written by Daniel Klann (http://www.ozgrid.com/forum/showthread.php?t=72794) to hide the password inputs.

The main

相关标签:
1条回答
  • 2020-11-28 16:16

    the standard InputBox returns empty fields and cancel the same way

    No it does not. It returns a null pointer (vbNullString) on cancel and an empty string ("") for empty input.

    Dim s As String
    s = InputBox("Test")
    
    If StrPtr(s) = 0 Then
      'Cancel pressed
    Else
      'Ok pressed
    End If
    

    Because InputBoxDK returns the InputBox's value unchanged, same logic applies to it.

    0 讨论(0)
提交回复
热议问题