Results 1 to 10 of 10

Thread: VB - An InputBox Form

Threaded View

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    VB - An InputBox Form

    The attached form looks exactly like the standard input box except that since it is a form you have full control over what you do with it. I've added the following properties to the form.

    VB Code:
    1. '   frmInputBox.ButtonClicked   ' Returns vbOK or vbCancel
    2.                                 ' depending on the button clicked
    3. '   frmInputBox.Default         ' Returns/sets the initial value
    4.                                 ' for user input
    5. '   frmInputBox.Display         ' Show the form modally
    6. '   frmInputBox.PasswordProtect ' Returns/sets whether characters
    7.                                 ' typed by the user are protected
    8.                                 ' by asterisks. (If this is set to True,
    9.                                 ' it doesn't make sense to set the Default
    10.                                 ' property.
    11. '   frmInputBox.Prompt          ' Set the InputBox Prompt value
    12. '   frmInputBox.Title           ' Set the InputBox Caption value

    Usage

    VB Code:
    1. frmInputBox.Title = "Value Entry"          
    2. frmInputBox.Prompt = "Please enter a value"    
    3. frmInputBox.Display  
    4.  
    5. If vbCancel = frmInputBox.ButtonClicked  Then
    6.     MsgBox "You pressed Cancel"
    7. End If
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width