Results 1 to 5 of 5

Thread: enter

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    enter

    yes i was wondering what the code is so that when ya hit enter it enter's the command button like ya clicked it

  2. #2
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: enter

    Just set the commands button Default property to true. That will make it so everytime you hit enter, that command button will be activated.
    You can also change it during runtime with
    Command1.Default = True ' Or False

    Hope that helps

  3. #3
    Member
    Join Date
    Apr 2005
    Location
    Hudson Falls, NY
    Posts
    36

    Re: enter

    It depends on what you want the code to do and what you are hitting enter on.... Your question is a bit unclear.
    Usually you enter your code in the sub procedure of a particular event. For instance in the click event of a command button, you would type your code in the Private Sub Command1_Click() section.

    Try a message box:

    VB Code:
    1. Private Sub Command1_Click()
    2.     MsgBox "Hello World!"
    3. End Sub

    Forgive me if this is not the question you were asking. Please try and give us a little more information as to what it is you are trying to accomplish.

    There are also alot of tutorials and code snippets available on this site that can be extremely helpful.

    I usually try and do searches of previous posts before I post my own question (90% of the time I find my answer w/o having to post) and try to give whatever code I have already written included in my post, otherwise I may not get any responses...

    Hope that helps

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    Re: enter

    ahhh helps verry mutch ty

  5. #5
    Member
    Join Date
    Apr 2005
    Location
    Hudson Falls, NY
    Posts
    36

    Re: enter


    Just set the commands button Default property to true. That will make it so everytime you hit enter, that command button will be activated.
    You can also change it during runtime with
    Command1.Default = True ' Or False
    doh.....

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