Results 1 to 7 of 7

Thread: msgbox getting a string

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Location
    Porto Alegre, RS
    Posts
    210

    msgbox getting a string

    how can i get a string prompted from my user?
    ex.: i click a button, it shows a message box asking for something, like your name, how can i do this???

    Thank you,
    Guilherme Costa

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Use the InputBox function.....
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Location
    Porto Alegre, RS
    Posts
    210
    How do you use this input box??

  4. #4
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  5. #5
    New Member
    Join Date
    Dec 2000
    Location
    Brussels (Belgium)
    Posts
    11
    Originally posted by gccosta
    How do you use this input box??
    Type the word "Inputbox" click on it and press F1.
    Bingo !

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106
    InputBox is much like MsgBox, but it returns a string. This is not the worlds best function, and I rarely use it, but it sure is fast to implement. I don't like it because it is so constrained in appearance and functionality.

  7. #7
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    296
    VB Code:
    1. Dim strName As String
    2. strName = InputBox("Please enter your name below then press enter.", "Enter your name please")
    3.     Select Case LCase(strName)
    4.         Case ""
    5.             MsgBox "You didn't enter a name, silly.", vbOKOnly + vbInformation, "Bah!"
    6.        
    7.         Case "carp"
    8.             MsgBox "You're not Carp, Carp made this small example for you though", vbOKOnly + vbInformation, "Silly"
    9.            
    10.         Case Else
    11.             MsgBox "Your name doesn't seem to be in our case,  Try something else!", vbOKOnly + vbInformation, "Who are you?!?!?"
    12.     End Select
    Kevin Carpenter
    Currently Working in the CAOS (CA Operating System) Group

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